Hi Jason, cannot wait to try your library.
However when I follow your set up quide, section "Tell $http to use a cache created by $angularCacheFactory for a specific request:" I get a "Unknown provider: $angularCacheFactoryProvide" error.
I have followed your example line by line and this is roughly what it's like:
var module = angular.module("myModule", []);
module.service('searchService', function ($http, $angularCacheFactory) {
$angularCacheFactory('dataCache', {
maxAge: 90000, // Items added to this cache expire after 15 minutes.
cacheFlushInterval: 600000, // This cache will clear itself every hour.
deleteOnExpire: 'aggressive' // Items will be deleted from this cache right when they expire.
});
return {
getSearchResults: function (url) {
var deferred = $q.defer(),
start = new Date().getTime();
$http.get(url, {
cache: $angularCacheFactory.get('dataCache')
}).success(function (data) {
console.log('time taken for request: ' + (new Date().getTime() - start) + 'ms');
deferred.resolved(data);
});
return deferred.promise;
}
};
});
Then in my controller Im injecting the searchService and using it.
Nothing else - very simple - I have included the js file (angular-cache.js 2.1.1, after the angular.js include).
Do you have any idea what it could be? it's probably the simplest thing...
Thank you, Thomas