Hi I have a observable user$ with a lot of properties (name, title, address...)
component{
user$:Observerable<User>;
constructor(private userService:UserService){
this.user$ = this.userService.someMethodReturningObservable$()
}
}
Is there a way to use the async pipe in the html template to subscribe to it and bind it to a local variable like this
<div #user="user$ | async">
<h3> {{user.name}}
</div>
I know can can subscribe to it in the constructor and then unsubscribe in OnLeave/OnDestroy but I was just curious if I could use the async pipe.
Cheers
*ngFor="let u of (user = (user$ | async))"
but seems fishy. need a bit practical. – Tinhorn