Hello Ionic 2 programmers.
I used Ionic 2 Storage to save data.
this.storage.set('username', 'value1');
this.storage.set('usertype', 'value2');
How to get data as synchronize?
I have created Class for set and get data.
export class UserData {
username: string;
constructor(public storage: Storage) {}
setUsername(username: string) {
this.storage.set('username', username);
};
getUsername() {
return this.storage.get('username').then((value) => {
this.username = value;
return value;
});
};
But I have never anything.