Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div *ngIf="(user$ | async) as user">
- <!-- In this div you do not need to put async pipe to all variable -->
- <h2> {{ (user$.name }}</h2>
- <!-- Without the user variable the syntax of async pipes could be heavy -->
- <h2>{{ (user$ | async)?.name }}</h2>
- </div>
- <div class="other-div">
- <!-- In this div user is not defined as it is not in the ngIf conatainer -->
- </div>
Add Comment
Please, Sign In to add comment