angular/angular.js — pull request #5011 by dmkc (2013-11-18 21:36:10+00:00)
Title: $http cache returning a promise

First stab at adding support for cache factories that return promises. The motivation for this was adding support for using IndexedDB as a backend of the cache factory when most operations on it are asynchronous and must therefore return promises.

I'm not completely happy with the duplication of code in the callback. Also, the mocking of the cache factory may not be the best practice. Feedback appreciated ).