Answers for "in single div how we use *ngIf in angular 8"

3

*ngIf and *ngFor in same container

<ng-container *ngIf="show">
  <div *ngFor="let thing of stuff">
    {{log(thing)}}
    <span>{{thing.name}}</span>
  </div>
</ng-container>
Posted by: Guest on December-01-2020
0

ngif else ng-container

<ng-container *ngIf="contributeur.deb; else newDeb" >
    ...
</ng-container>
<ng-template #newDeb>
    ...
</ng-template>
Posted by: Guest on November-06-2020

Browse Popular Code Answers by Language