Local storage vs AngularJS $cacheFactory

后端 未结 4 639
刺人心
刺人心 2020-12-12 12:27

I have a problem of storing a lot of client-side data, and I can\'t decide which way is better. Now I\'m using AngularJS\'s cacheFactory, it works fine, but all data reloads

4条回答
  •  情书的邮戳
    2020-12-12 13:26

    If your goal is to store client-side and persistent data, you can't use the $cacheFactory, which just caches the data for the current session.

    One solution is to use the new local storage API. This awesome Angular module makes all the dirty job for you, and even falls back to cookies for old browsers!

提交回复
热议问题