@miropolis wrote:
Hello,
right now I am trying to use a variable I am getting from my storage in the constructor of one of my pages. When I try to acces this variable in the constructor ( as inconsole.log("Number: ", number);) it returns null.
What am I doing wrong?
This is my constructor:constructor(public navCtrl: NavController, private storage: Storage, public navParams: NavParams) { let number; this.storage.get('group').then((val) => { number = val; }); storage.ready().then(() => { console.log("Number: ", number); }); }
Posts: 2
Participants: 2