i have a problem with asynchronous loading data from server. In view are no any data because rendering is before load. Here is my code: app.component.ts:
user: User = new User()
ngOnInit() {
this.userService.getUser(1).then(usr => {
this.user = usr;
}).catch((error: any) => {
});
}
app.component.html:
<p>{{user.name}}</p>
I thought that the data would change dynamically. Where is problem? Thanks
<p>{{user?.name}}</p>?this.userafter assignment in async call and show us the contentDetectionStrategyin this\parent component?userno longer had propertyname;)