* Callback registered to $httpBackend(): * - caches the response if desired * - resolves the raw $http promise * - calls $apply
(status, response, headersString, statusText)
| 8466 | * - calls $apply |
| 8467 | */ |
| 8468 | function done(status, response, headersString, statusText) { |
| 8469 | if (cache) { |
| 8470 | if (isSuccess(status)) { |
| 8471 | cache.put(url, [status, response, parseHeaders(headersString), statusText]); |
| 8472 | } else { |
| 8473 | // remove promise from the cache |
| 8474 | cache.remove(url); |
| 8475 | } |
| 8476 | } |
| 8477 | |
| 8478 | resolvePromise(response, status, headersString, statusText); |
| 8479 | if (!$rootScope.$$phase) $rootScope.$apply(); |
| 8480 | } |
| 8481 | |
| 8482 | |
| 8483 | /** |
no test coverage detected