Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The reason that you aren't seeing a request fired off is that as part of the $http call, the config is passed around to each interceptor as a promise.</p> <p><a href="https://github.com/angular/angular.js/blob/b99d064b6ddbcc9f59ea45004279833e9ea82928/src/ng/http.js#L665-L670" rel="nofollow">https://github.com/angular/angular.js/blob/b99d064b6ddbcc9f59ea45004279833e9ea82928/src/ng/http.js#L665-L670</a></p> <p>In angular, $q promises are only resolved at the beginning of a $digest cycle. As a result, your HTTP request won't even be fired off until a $digest cycle happens, which is why you're seeing that wrapping a $timeout around it helps ( a timeout causes a $digest ).</p> <p><a href="https://github.com/angular/angular.js/blob/2a5c3555829da51f55abd810a828c73b420316d3/src/ng/q.js#L160" rel="nofollow">https://github.com/angular/angular.js/blob/2a5c3555829da51f55abd810a828c73b420316d3/src/ng/q.js#L160</a> <a href="https://github.com/angular/angular.js/blob/3967f5f7d6c8aa7b41a5352b12f457e2fbaa251a/src/ng/rootScope.js#L503-L516" rel="nofollow">https://github.com/angular/angular.js/blob/3967f5f7d6c8aa7b41a5352b12f457e2fbaa251a/src/ng/rootScope.js#L503-L516</a></p> <p>You can also verify this by re-creating the error condition you're seeing and watching network requests. After you run this, you should see your request fire off:</p> <pre><code>angular.element( "[ng-app]" ).scope().$digest() </code></pre> <p>That code fires off a $digest cycle on the $rootScope, causing your unresolved promises to become resolved.</p> <p>See this issue for more discussion, because I agree that this is surprising behavior.</p> <p><a href="https://github.com/angular/angular.js/issues/2881" rel="nofollow">https://github.com/angular/angular.js/issues/2881</a></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload