I have a ng-if, I have a ng-for that shows me all the products I have, and I want to do in my ng if a validation that only shows when the array is empty or does not exist, this Is to display a message that products are not found on the page, Thank you! ;)
I try with "!ProductsCar" , but it does not work.
Code :
<ion-list *ngFor="let productsCar of productsCar">
<ion-item-sliding>
<ion-item class="item-prod">
<ion-thumbnail item-start>
<img src="https://speedomart.000webhostapp.com/SPEEDOMART/{{productsCar.imagen}}">
</ion-thumbnail>
<div class="info-prod">
<h2><b>{{productsCar.nombre}}</b></h2>
<p>Codigo de barra : {{productsCar.codigo}}</p>
<ion-icon name="md-pricetag"></ion-icon><b> $ {{productsCar.precio}}</b>
</div>
</ion-item>
<ion-item-options side="right">
<button ion-button color="danger" (click)="borrarCar(productsCar)">
Borrar
</button>
</ion-item-options>
</ion-item-sliding>
<div *ngIf="!productsCar">No tiene productos en su carro...</div>
</ion-list>