Answers for "ngif and ngfor"

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
11

ngfor

<li *ngFor="let item of items; index as i; trackBy: trackByFn">...</li>
Posted by: Guest on March-31-2020

Browse Popular Code Answers by Language