angularjs cacheFactory is empty -
i store keys in cache using angularjs cachefactory
myapp.factory('somecache', function ($cachefactory) { return $cachefactory('somecache', { capacity: 10 // optional - turns cache lru cache }); });
in code :
somecache.put(key, value);
i see keys , values in console. problem , when redirect page, not in website ( e.c www.ebay.com) , come cache object empty, needd preserve data on page.
any idea ? ishay
the behaviour see $cachefactory expected. angularjs-cache not persist between page refreshes. see also: angularjs: date expiration $cachefactory
what need use persist data between page refreshes localstorage or sessionstorage explained on site: dom storage guide
you should use excellent ngstorage module.
Comments
Post a Comment