The AngularJS documentation for $http at http://docs.angularjs.org/api/ng.$http states "The $http service will not actually send the request until the next $digest() is executed.".
I was just wondering why it does not just make the HTTP request immediately? It seems like an unnecessary requirement, I wonder what I am missing.
UPDATE: Its been suggested that this is necessary because the completion handlers will need to update the digest. However, those completion events will need to make their own $apply/$digest call later either way.
It's actually because $http is promise based. Full explanation here: https://github.com/angular/angular.js/issues/2794#issuecomment-18807158
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With