Ionic and Local Storage? (Saving some simple settings)


I was creating an app and needed to save some settings:

I thought to myself: What’s the best way to store this settings?
Answer: Since I’m using “web technologies” I will use the “Local Storage” thing that is available in the browsers/phones (webview)

So I found an Angular Module to help me:

The problem: On my Chrome browser it works perfectly. On my phone (OnePlus One) doesnt seem to be able to store anything… (closing the app loses everything)

“Partial solution:” A coworker showed me another module:
This one seems to works, but I’ve already coded the app using the first one…

Question: How would you guys store those “simple” settings on the device?

Thanks for your help!

I use this simple factory:

I think there is no need to use other modules, handling localstorage is pretty simple

I’ve stopped using both libraries and only used “your code” (more precisely the one in the documentation: and it’s working…!

Yep it’s a super effective factory Max made, I just added the clear method.