Local storage BUG in version 1.0.0-beta.14?

I’m not sure whether it is because of angular 1.3 or ionic 1.0.0-beta. 14, to access the local storage the page needs to be refreshed manually, otherwise the binded data from the local storage does not load/populate when the view has been changed. In ionic 1.0.0-beta.13, the data from the local storage loads automatically without manually refreshing the page whenever the view have been changed.

Is anybody having the same issue? Please advise on what might be the issue here?

Thank you.

I’ve actually had this issue with any of my angular apps from 1.2 and 1.3, it’s caused by the order in which angular does things. So i usually have to wrap that code that is utilizing the local storage in a timeout with the actual local storage code before it. This way it has that micro second of time to load from local storage, and then use the data. I haven’t had an issue with doing the time out at all, hasn’t altered anything or changed any there code structure but that.

Try it out and see if it works?

In Ionic Beta 14 the caching of views has been changed, see the blog post: http://ionicframework.com/blog/navigating-the-changes/ (View LifeCycle).

So the view, scope and controller is loaded once, but you can listen to events to do some stuff…

1 Like

Thank you for responding. I’ll give it a try.

Also, I have a situation where I am able to access my local storage (in ionic 1.0.0-beta. 13), and bind it to the views in the template and the data loads/shows up fine in the browser, as well as iOS simulator. But as soon as I load to actual iOS device, the data from local storage never loads/shows when routed to that templet. Basically it just shows a blank page. Could not exactly debug it as it works fine in the browser and simulator.

Have you had any sort of similar situation? Any thoughts on what could be causing it to do so?

Thank you @markdark. Never really realized that, will be reading on how to implement that.

2 Likes