mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-16 23:30:23 +00:00
docs($http): explain why $http may not make the request immediately
I came across this issue today and after researching has found out this thread on so: http://stackoverflow.com/questions/17039998/angular-not-making-http-requests-immediately. It took me quite sometimes to figure out this so I hope the addition in documentation could save somebody else some times and frustration.
This commit is contained in:
parent
9ef5d8f318
commit
16c7ab1ba0
1 changed files with 4 additions and 0 deletions
|
|
@ -185,6 +185,10 @@ function $HttpProvider() {
|
|||
* will result in the success callback being called. Note that if the response is a redirect,
|
||||
* XMLHttpRequest will transparently follow it, meaning that the error callback will not be
|
||||
* called for such responses.
|
||||
*
|
||||
* If your $http is scheduled from something that doesn't cause a $digest to fire then your
|
||||
* request won't be sent immediately. To make sure a $http request if fired immediately, wrap your
|
||||
* call around with an $scope.$apply(function(){ //make $http request here }
|
||||
*
|
||||
* # Shortcut methods
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in a new issue