Reputation: 8955
I am using Ionic2/Angular2.
I am looking to store data on the users device/browser. I could use Local Storage, but have read it's not reliable.
SQLite is reliable, but is SQL and not JSON. Also, I think it won't work in a browser because it requires a Cordova plugin.
Question
Is there a way to store JSON reliably locally accessible from a devise and a browser?
Thanks
Upvotes: 1
Views: 422
Reputation: 29635
Sounds like you are looking for Ionic Storage.
In the case of browser it will pick the browser storage available.
If you prefer sqlite
you have to install:
ionic plugin add cordova-sqlite-storage --save
The API takes key-value pairs to read/write to db. So storing json data is possible.
Upvotes: 2