TypeError when cleaning or renewing cache
Closed this issue · 1 comments
pietro909 commented
Hello, I'm trying to force the request invalidating the cache this way:
var id = "myCache";
var cfg = { storageMode: "localStorage" };
var cache = cacheFactory.createCache(id, cfg);
// perform HTTP requests and get the result, cache is working well...
// ...now need to refresh data from server
cacheFactory.destroy(id);
cache = cacheFactory.createCache(id, cfg);
// perform again HTTP requests passing the new cache:
// they are working as well but then I get...
TypeError: Cannot use 'in' operator to search for 'myApiUrl' in null at Object.e.(anonymous function).get [...]
Actually is failing at index.js:274 because $$data is null
if (!(key in $$data)) {
return;
}
What am I doing wrong? I get the same error even using:
cache.removeAll();
// error in next request
Thank you!
pietro909 commented
Update: I built up a very small example and is working fine (angular-cache 4.2.2).
In my application cache management and requests are handled in different modules, so is a problem on my side.