Error: AngularCache.get(key, options): options: must be an object!
at j.get (http://localhost:8000/js/lib/angular-cache-2.2.0.min.js:10:9935)
var invitationsCache = $angularCacheFactory('invitationsCache', {maxAge : 1000, // Items added to this cache expire after 5 minutes.recycleFreq : 20000, // Check for expiry every 20 secondsdeleteOnExpire : 'passive', // Items will be deleted from this cache right when they expire.storageMode : 'localStorage',verifyIntegrity : true});
var isGoodThisYear = true;
var value = invitationsCache.get('invitations',
{ onExpire : function (key, value) {
console.log('It has expired!');
if (isGoodThisYear) {
console.log('Just putting them back');
invitationsCache.put(key, value);
} else {
console.log('Going to get new');
$http.get(invitations).success(function (data) {
invitationsCache.put(key, data);
});
}
}
});