export class Component implements OnInit {
obj:string;
img:string;
username:string = '';
email:string;
bio:string;
constructor(private authService:AuthService) {
this.authService.user
.subscribe((userVal) => {
this.obj = JSON.stringify(userVal);
this.username = userVal.username;
console.log(this.username);
})
}
Now this doesn't work, you can log the response but not display it in the component view
You can find a few hack like this here: Angular 6 View is not updated after changing a variable within subscribe
None of the options seem to work that are presented here
Anyone got a solution? If its not possible with any clear way then Angular is doomed