AngularJS: Why does $http not actually make a http request until you leave the current digest?

Viewed 513

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.

1 Answers
Related