Chrome Extension

ngIf + ngFor

<ng-container *ngFor="let product of products;">
  <ng-container *ngIf="product.isInStock">
    <div class="my-class">
      Name: {{}}
Best JSON Validator, JSON Tree Viewer, JSON Beautifier at same place. Check how cool is the tool

Angular doesn't allow having both *ngFor and *ngIf for a single element. So, better to have them separate like this.

Was this helpful?
Join Devsheet Ask a Question