IonicView storage.clear() bug


#1

I try when app is started to remove all data saved in the storage,

in the file app.component.ts i write this code.

constructor(public platform: Platform, public storage: Storage) {
this.storage.clear();
this.initializeApp();
}

now it works perfectly in the ionic web view and on android simulator, but if i try to start on IonicView (iOS version) the datas aren’t cleared and the app get the data from the local storage.

Any solution for me?


#2

As we’ve discussed elsewhere, you probably don’t really need to be interacting with storage at all here, but I suspect that your problem here might be not waiting until it’s ready before trying to access it. See the section about ready() in the ionic-storage README.


#3

u can use in the constructor
storage.clear();
on The device should work well