lacolaco
11/3/2017 - 12:08 AM

ngif-async-as-else.html

<div *ngIf="user$ | async as user; else userNotFound"> 
  <p>{{ user.name }}</p> 
  <p>{{ user.age }}</p> 
  <img [src]="user.icon"> 
</div> 
<ng-template #userNotFound> 
  <p>not found</p> 
</ng-template>