jmdobry / angular-cache

angular-cache is a very useful replacement for the Angular 1 $cacheFactory.
http://jmdobry.github.io/angular-cache
MIT License
1.39k stars 156 forks source link

Question: Does the cache engine only work on properties? #145

Closed angelxmoreno closed 9 years ago

angelxmoreno commented 9 years ago

I am caching a Class and I am only getting back the properties.

jmdobry commented 9 years ago

This question belongs on the mailing list.

Are you using localStorage mode? If so, localStorage is only capable of storing strings, so your cached value must be JSONified before put into localStorage, so when you pull it back out, all you get is the parsed json string, without any prototype properties.