I'm building an app using AngularJS. I need to store some data across sessions. I thought the $cacheFactory
might be an option. However, I can't figure out where the Cache object actually stores the data.
Can someone tell me how to store data on the client-side across sessions in AngularJS? Is the $cacheFactory
even an option for this scenario?
Thank you
$cacheFactory
merely stores the data in a JSON dict (called caches
at the time of writing) and the data will be lost as soon as the app is reloaded.
The only persistent storage option you have while remaining browser compatible is cookies. If you support only modern browsers (>IE8), then you can consider using the HTML5 localStorage
provided by the browser as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With