My latest project involved creating a table that displays various products along with their corresponding images. Everything was working smoothly until I encountered an issue.
In instances where a product is created without an associated image, I decided to use a default image instead. However, the problem lies in the fact that the default image is showing up alongside the actual image space, making it seem like there's a problem when all I want is for the default image to be displayed alone.
Has anyone else experienced this issue and knows why it might be happening?
https://i.sstatic.net/FZlMu.png
HTML
<table class = "gfg" *ngFor="let product of products; let a = index;">
<tr>
<td class = "geeks">
<div *ngIf="imagMap.get(product.id) == null">
<img src="./assets/semimagem.png" class="imgTable img-fluid" alt="">
</div>
<img [src]="imagMap.get(product.id)" class="imgTable img-fluid">
</td>
</tr>
</table>