면책 조항 : 저는 AngularJS의 초보자입니다.
약속이 반환 된 후에 $ scope를 (를) 업데이트하려고하는데 작동하지 않습니다. 여기에 단순화 된 코드는 다음과 같습니다
.controller('ChooseRewardCtrl', ['$scope', ...,
function($scope, ...) {
// scope data
$scope.points = CardModel.points;
// function called to refresh points
$scope.refresh_points = function() {
return CardModel.refresh_points() // This is a promise that changes CardModel.points value
.then(function(data){
$scope.$apply() // Throw error (cf. above)
})
}
}
은 내가
Error: [$rootScope:inprog] $digest already in progress
나는이 오류에 대한 포스트를 많이 본 적이 있지만, 내가 직접 내 문제에 연결할 수 아무것도 얻을.
감사합니다.
CarModel.refresh_points()는 $ q 또는 정상 약속을 반환합니까? 그렇다면 $ scope ($ scope)가 필요하지 않습니다. $ apply() – wjohnsto
정상적인 약속입니다 –