actually am new in ionic v2.Set storage value into the login.ts file. i want to getting storage value into the welcome.ts file.
how can i do that .please give me an example of code.
actually am new in ionic v2.Set storage value into the login.ts file. i want to getting storage value into the welcome.ts file.
how can i do that .please give me an example of code.
Pages should not be interacting with storage. That should go through a service provider instead.
I have answered your question already why did you make another topic?
@FnnHuman Actually i’m new in ionic.that’s why am asking.if u have any problem. please skip this topic
@rapropos my userdata service provider code look like this.i’m right or not.
setUserId(userid: string): void {
this.storage.set(‘userid’, userid);
};
setUserId(): Promise {
return this.storage.get(‘userid’).then((value) => {
return value;
});
};
};
and this my login.ts file code
this.userData.setUserId(this.setUserId.userid);