I have a reactive form and I need to show this card only when in my array listAtributos[i].indexvariacaoatributo
is different from null
. It turns out that there is initially no indexvariacaoatributo
, so it returns:
Can not read property 'indexvariacaoatributo' of undefined
What I've tried:
<ng-container *ngFor="let item of variacoes.controls; let i = index;">
<div *ngIf="listAtributos[i].indexvariacaoatributo !== undefined && listAtributos[i].indexvariacaoatributo !== null" class="animacaogeral animated zoomIn">
Is there any alternative for me to just show this card when my property in my array (indexvariance attribute) is different from null before it exists?