MCPcopy
hub / github.com/angular-ui/ui-router / done

Function done

test/angular/1.4/angular.js:10854–10874  ·  view source on GitHub ↗

* Callback registered to $httpBackend(): * - caches the response if desired * - resolves the raw $http promise * - calls $apply

(status, response, headersString, statusText)

Source from the content-addressed store, hash-verified

10852 * - calls $apply
10853 */
10854 function done(status, response, headersString, statusText) {
10855 if (cache) {
10856 if (isSuccess(status)) {
10857 cache.put(url, [status, response, parseHeaders(headersString), statusText]);
10858 } else {
10859 // remove promise from the cache
10860 cache.remove(url);
10861 }
10862 }
10863
10864 function resolveHttpPromise() {
10865 resolvePromise(response, status, headersString, statusText);
10866 }
10867
10868 if (useApplyAsync) {
10869 $rootScope.$applyAsync(resolveHttpPromise);
10870 } else {
10871 resolveHttpPromise();
10872 if (!$rootScope.$$phase) $rootScope.$apply();
10873 }
10874 }
10875
10876
10877 /**

Callers 2

jsonpReqFunction · 0.70
stateSpec.tsFile · 0.50

Calls 3

isSuccessFunction · 0.70
parseHeadersFunction · 0.70
resolveHttpPromiseFunction · 0.70

Tested by

no test coverage detected