Guest User

Untitled

a guest
Oct 20th, 2017
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. <div *ngIf="(user$ | async) as user">
  2. <!-- In this div you do not need to put async pipe to all variable -->
  3. <h2> {{ (user$.name }}</h2>
  4. <!-- Without the user variable the syntax of async pipes could be heavy -->
  5. <h2>{{ (user$ | async)?.name }}</h2>
  6. </div>
  7. <div class="other-div">
  8. <!-- In this div user is not defined as it is not in the ngIf conatainer -->
  9. </div>
Add Comment
Please, Sign In to add comment