Closed dmitrybelyakov closed 11 years ago
$cacheFactory has limited functionality, and no ability to remove all caches at once.
With $angularCacheFactory you could do the following to clear all caches:
var keySet = $angularCacheFactory.keySet();
for (var key in keySet) {
$angularCacheFactory.get(key).removeAll();
}
or
var keySet = $angularCacheFactory.keySet();
for (var key in keySet) {
$angularCacheFactory.get(key).destroy();
}
Yes, I was reffering to angularCacheFactory. Thanks for the tip and an awesome lib!
No problem!
Do you think it is worth it to add removeAll()
and clearAll()
to the $angularCacheFactory
object?
Yes, please (in my opinion)! :)
On Tuesday, September 3, 2013, Jason Dobry wrote:
No problem!
Do you think it is worth it to add removeAll() and clearAll() to the $angularCacheFactory object?
— Reply to this email directly or view it on GitHubhttps://github.com/jmdobry/angular-cache/issues/37#issuecomment-23724905 .
K. They should make it into v1.1.0.
Yes and thank you. That would be quite convenient :)
Hi there!
It might be nice to have an option to clear all caches without calling each one by name. I think I can wrap cache factory to keep track of all the created caches but maybe there is such an option already?