Hi Nhut,
It's not very usual to wrap promises inside an object, and it's making
handing your data harder.
You can use Promise.all to make your function return a promise that
resolves when all data is in.
public getCredential() {
return Promise.all([this.secureStore.get('uname'), this.secureStore.get(
'pwd')]).then(
([uname, pwd]) => ({ uname, pwd })
);
}
An observation. You seem to stroe your passwords in plaintext. Which is
fine for a demo app, but a huge security risk anywhere else.
Regards
Sander
--
You received this message because you are subscribed to the Google Groups
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/angular/5f7be89e-7b37-44a6-960b-7b57e1f5018e%40googlegroups.com.