Hey there! So, I have this observable called user$ which has a bunch of properties such as name, title, and address.
component{
user$:Observable<User>;
constructor(private userService:UserService){
this.user$ = this.userService.someMethodReturningObservable$()
}
}
I was wondering if there's a way to utilize the async pipe in the HTML template to subscribe to it and bind it to a local variable like below:
<div #user="user$ | async">
<h3> {{user.name}}
</div>
I am aware that I can manually subscribe to it in the constructor and then unsubscribe in OnLeave/OnDestroy. However, I'm just curious if using the async pipe is possible for this scenario.
Cheers!