How to make a ngif inside an ngfor

0

How to make a ngif inside an ngfor

    
asked by anonymous 28.03.2018 / 16:08

1 answer

0

<ion-card *ngFor="let item of produtos" *ngIf="produtos.length > 0">
<!-- conteúdo dentro do html -->
</ion-card>

The condition " products.length> 0 " checks if the products array has size greater than zero (1,2,3 ... n), if any, it shows the rest of the content, if there is none, the content inside the tag with ng-if (in this case, the ion-card) will not appear.

    
10.07.2018 / 15:02