Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 228595

UPDATED: Persist radio button selection in localStorage populates to all ng-repeat

$
0
0

Be honest the local storage is not the best place to store your data. It is more notepad than a database. You cant really simulate a full CRUD via window.localStorage.xxxItem(). At least you need some good tooling/API . If you insist on localstorage you can use https://github.com/auth0/angular-storage .
But I would recommend you something more stable, I believe both Android and iOS could eventually release the 'memory' during the weekly cleaning. You can go with Localforage ( https://github.com/ocombe/angular-localForage) or brand new Lovefield (https://github.com/ben--wood/LoveField-Starter).
I would personally recommend you the http://www.js-data.io/ . It has a huge overhead at the beginning but thereafter you have an data driven app that uses single interface for all databases. In Ionic apps you can use the localforage adapter just for persistency, and once you need a real server-side database, you just change the adapter [abt 5 LOC in .config()] and everything should work.

P.S. http://pouchdb.com/ is another great option.


Viewing all articles
Browse latest Browse all 228595

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>