function done (status, response, headersString, statusText) {
            if (cache) {
              if (isSuccess(status)) {
                cache.put(url, [status, response, parseHeaders(headersString), statusText]);
              } else {
                // remove promise from the cache
                cache.remove(url);
              }
            }

            function resolveHttpPromise () {
              resolvePromise(response, status, headersString, statusText);
            }

            resolveHttpPromise();

            if (isScope(config.scope)) {
              config.scope.$applyAsync();
            }
          }
/**
           * Callback registered to $httpBackend():
           *  - caches the response if desired
           *  - resolves the raw $http promise
           *  - calls $apply
           */
Callback registered to $httpBackend():
- caches the response if desired
- resolves the raw $http promise
- calls $apply
Callback registered to $httpBackend () : - caches the response if desired - resolves the raw $http promise - calls $apply
function done (status, response, headersString, statusText) {
            if (cache) {
              if (isSuccess(status)) {
                cache.put(url, [status, response, parseHeaders(headersString), statusText]);
              } else {
                cache.remove(url);
              }
            }
            function resolveHttpPromise () {
              resolvePromise(response, status, headersString, statusText);
            }
            resolveHttpPromise();
            if (isScope(config.scope)) {
              config.scope.$applyAsync();
            }
          }
function done ( status , response , headersString , statusText ) { if ( cache ) { if ( isSuccess ( status ) ) { cache . put ( url , [ status , response , parseHeaders ( headersString ) , statusText ] ) ; } else { cache . remove ( url ) ; } } function resolveHttpPromise ( ) { resolvePromise ( response , status , headersString , statusText ) ; } resolveHttpPromise ( ) ; if ( isScope ( config . scope ) ) { config . scope . $applyAsync ( ) ; } }
Callback registered to $httpBackend():
  - caches the response if desired
  - resolves the raw $http promise
  - calls $apply
Callback registered to $httpBackend () : - caches the response if desired - resolves the raw $http promise - calls $apply
// remove promise from the cache