I think you are looking at this issue: https://github.com/angular/angular.js/issues/2371. You may want to follow up.
AngularJS - resource - doas a request have to be inside $scope.$apply?
-
03-04-2022 - |
質問
I could not find anything in the docs about this, but it seems that any request has to be inside a $apply()
call - (wether this $apply()
call comes from an action or is invoked manually).
I can not explain this strange behavior any other way:
// inside a controller
$scope.resources = Resource.query();
// a request gets sent
works just fine, but
// somewhere else - in a callback for auto-complete
// just to show that this is outside $scope.$apply() - not realy setTimeout
setTimeout(function(){
$scope.resources = Resource.query();
},100);
// no request gets sent;
});
解決
所属していません StackOverflow