Sqlstorage example


#1

I followed this example: https://blog.nraboy.com/2015/12/use-sqlite-in-ionic-2-instead-of-local-storage/ .

I am able to set all the storage, but when I leave the app and comeback the data is no longer there.

My main objective is to get some information from my server and store locally on the device. May someone please show a very basic example of how to do this?

I used the following docs: http://ionicframework.com/docs/v2/api/platform/storage/SqlStorage/ , but I am unable to make the data persist.

Cheers


#2

Hi

Can you give more detail, as to what device(s) you’re using, have you installed/removed the app.
If you run app in chrome can you see items being added in the developer tools -> resources -> web sql -> _ionicstorage -> dbname

The more you can tell us, the more we can help you

Best Regards


#3

To make it persistent you have to add Cordova-sqlite-storage plugin to your project.