acanimal
acanimal

Reputation: 5020

Right way to store data on an angular mobile app

I'm working on an AngularJS based mobile app using Cordova and required to persist data locally.

I see Cordova offers an API to local storage via window.localStorage, but I have a bunch of unclear questions:

Thanks.

Upvotes: 1

Views: 758

Answers (1)

user924016
user924016

Reputation:

The Cordova docs

localStorage, Provides access to the W3C's Web Storage interface.

So window.localStorage === HTML5 localStorage.

The w3c Web sotrage interface says This specification defines an API for persistent data storage of key-value pair data in Web clients.

So yes, it should be persistent (and not flushed away after x time), but you have to check up which each vendor you want to support, how they handle low-memory, limits, flushing (if any)..

IndexedDB space limit is also vendor specific, but it is never unlimited (then it would be pretty easy to fill your memory .. )

Upvotes: 1

Related Questions