$cacheFactory
ng
Factory that constructs cache objects and gives access to them.
var cache = $cacheFactory('cacheId');
expect($cacheFactory.get('cacheId')).toBe(cache);
expect($cacheFactory.get('noSuchCacheId')).not.toBeDefined();
cache.put("key", "value");
cache.put("another key", "another value");
// We've specified no options on creation
expect(cache.info()).toEqual({id: 'cacheId', size: 2});
$cacheFactory(cacheId[, options]);
| Param | Type | Details |
|---|---|---|
| cacheId | string | Name or id of the newly created cache. |
| options (optional) | object | Options object that specifies the cache behavior. Properties:
|
| object | Newly created cache object with the following set of methods:
|
Get information about all the of the caches that have been created
| Object |
|