Angularをバージョン1.6.4にアップデートしました。.getAll(...)。thenは関数ではありません。
TypeError: .getAll(...).then is not a function
問題がサービスにここにある:ここで
function getAll(page, size) {
return $http.get(baseUrl + '/jobprofiles?page='+page+'&size='+size, {timeout: 5000}).then(function (response) {
data = response;
}), (function(response) {
alertService.setAlert({'message': 'jobmatch.server.unavailable', 'classified': 'danger', 'lives':1});
});
}
はコントローラです:
は、だから私は今、私は次のエラーを取得する.success
と
.error
.then
へを更新しました
if($cookies.get("authenticated")=='true'){
//get a list of all candidateprofiles with the use of a page and a size
candidateprofilesService.getAll($scope.page, $scope.size).then(function() {
$scope.data = candidateprofilesService.getData()._embedded.candidateprofiles;
candidateprofilesService.getAll($scope.page, $scope.size+10).then(function() {
if(candidateprofilesService.getData()._embedded.candidateprofiles.length > $scope.data.length){
$scope.moreData = true;
}
else {
$scope.moreData = false;
}
})
});
}
あなたcandidateprofilesServiceでのgetAllを暴露していますか? –