HI all, I can use local storage most of the situation. However, this time I need to use local storage within this.platform.ready().then().
I am getting the Typescript error, : Cannot read property ‘local’ of undefined.
I am wondering how to define local storage function within this.platform.ready().then()
Could anyone give a help?
Many thanks.
APP.ts
import {Storage, LocalStorage} from 'ionic-angular'; @Component({ templateUrl: 'build/app.html' }) class MyApp { public local: Storage; constructor(private platform:Platform){ this.initializeApp(); } initializeApp() { this.platform.ready().then(() => { savesth(); } function savesth(){ this.local.set('saveValue', 'test'); } } ionicBootstrap(MyApp);