-
Notifications
You must be signed in to change notification settings - Fork 27.5k
$http requests are sometimes queued and not triggered as expected #2794
Comments
I've written a simple small API library which performs the requests using the Angular $http object, but all of these calls are actually triggered by $scope methods, so in theory it would be within Angular's context. Also it works just fine on .get() requests, which use the exact same logic apart from the method being different. |
@Naatan perhaps just before your second request you actually called (not directly) a $scope.$apply(), causing the model changes of your first get() to be noticed by angular? |
@Naatan This is a side-effect of promise-based request interceptors introduced in 1.1.4. Now request interceptors are promise-based and AngularJS promises are only resolved within $digest cycle. As from 1.1.4 you need to trigger In your particular case you need to wrap a call into See those 2 comments in #2431 for additional info: Please reopen with a reproduce scenario (plunker) if you need further help on this one. |
I have a $http.post with very normal looking parameters:
http://pastebin.com/VhDX5CuG
However the actual request seems to just be queued and isn't processed until I actually make another $http.get request. I can force it to be processed by calling $scope.$apply() but that doesn't seem right.
This is on 1.1.5.
The text was updated successfully, but these errors were encountered: