Angular *ngIf variable with async pipe multiple conditions

后端 未结 4 698
再見小時候
再見小時候 2021-02-12 05:31

There\'s quite good doc of using *ngIf in Angular: https://angular.io/api/common/NgIf But, is that possible to have *ngIf async variable and multiple checks on that? Something l

4条回答
  •  再見小時候
    2021-02-12 06:15

    Simply do it like this

    ...

    For "more complex" scenario do the following

    ...

    Edit: Previous wouldn't work since you cannot use *ngFor and *ngIf without using ng-template. You would do it like that for instance

    
      
    {{ user | json }}

    Here is a stackblitz.

提交回复
热议问题