Normally I use *ngIf if I want to exclude something from my *ngFor loop.
However in this case I can't.
.HTML
<div class="grid">
<div *ngFor="let food of foods | async " >
<ion-card *ngIf="food.data.name !=''">
{{food.data.name}}
</ion-card>
</div>
<div>
this is an overly simplified version of the code.
I'm doing a grid pattern of each row having two <ion-card>
.
I'm trying to skip over the elements in the array that have a blank name ""
.
Since this is an async loop, at any moment those ""
names could hold real values and will automatically update the grid.
However, using *ngIf is leaving blank spaces in the grid instead of skipping over those areas that have a ""
name.
I heard there are ways of using pipes for *ngFor for passing over arguments.
I haven't managed to get any to work.
I am on Ionic 6.10.1