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

Function resolvePromise

test/angular/1.4/angular.js:10880–10891  ·  view source on GitHub ↗

* Resolves the raw $http promise.

(response, status, headers, statusText)

Source from the content-addressed store, hash-verified

10878 * Resolves the raw $http promise.
10879 */
10880 function resolvePromise(response, status, headers, statusText) {
10881 //status: HTTP response status code, 0, -1 (aborted by timeout / promise)
10882 status = status >= -1 ? status : 0;
10883
10884 (isSuccess(status) ? deferred.resolve : deferred.reject)({
10885 data: response,
10886 status: status,
10887 headers: headersGetter(headers),
10888 config: config,
10889 statusText: statusText
10890 });
10891 }
10892
10893 function resolvePromiseWithResult(result) {
10894 resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText);

Callers 3

sendReqFunction · 0.70
resolveHttpPromiseFunction · 0.70
resolvePromiseWithResultFunction · 0.70

Calls 2

isSuccessFunction · 0.70
headersGetterFunction · 0.70

Tested by

no test coverage detected