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

Function done

lib/test/angular/1.8.0/angular.js:13393–13413  ·  view source on GitHub ↗

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

(status, response, headersString, statusText, xhrStatus)

Source from the content-addressed store, hash-verified

13391 * - calls $apply
13392 */
13393 function done(status, response, headersString, statusText, xhrStatus) {
13394 if (cache) {
13395 if (isSuccess(status)) {
13396 cache.put(url, [status, response, parseHeaders(headersString), statusText, xhrStatus]);
13397 } else {
13398 // remove promise from the cache
13399 cache.remove(url);
13400 }
13401 }
13402
13403 function resolveHttpPromise() {
13404 resolvePromise(response, status, headersString, statusText, xhrStatus);
13405 }
13406
13407 if (useApplyAsync) {
13408 $rootScope.$applyAsync(resolveHttpPromise);
13409 } else {
13410 resolveHttpPromise();
13411 if (!$rootScope.$$phase) $rootScope.$apply();
13412 }
13413 }
13414
13415
13416 /**

Callers 1

jsonpReqFunction · 0.70

Calls 3

isSuccessFunction · 0.70
parseHeadersFunction · 0.70
resolveHttpPromiseFunction · 0.70

Tested by

no test coverage detected