Hi! After a user logs in I save the user as “currentUser” in NativeStorage with no problem at all.
In another component “HomeComponent” I need to access that item and show some attribute in the template.
this.nativeStorage.getItem("currentUser").then(
(user) => {
console.log("currentUserrrrrr", user, 'JAPI', this);
this.currentUser = user;
},
error => {
console.log("CurrentUser", error);
}
);
This works fine, but when I do this in the template:
<h1>Welcome {{currentUser.assesor.name}}</h1>
It seems to have broken the page and now I only see a white screen. I inspected it and I get this:
vendor.js:1377 ERROR TypeError: Cannot read property ‘asesor’ of null
I know that getItem is async. I’ve tried to use the " {{ expression | async }} " pipe but it also breaks.
It’s urgent. Please some one give me a clue. Thank you all in advance.