jeudi 2 septembre 2021

Setting and Passing Parameter Does Not Work When There Are 2 ngIf in the Div

I have a block of html code that has 2 *ngIf:

 <div *ngIf="('Article image' | translate) + ' 1'; let articleImage1Alt" > 
      <img *ngIf="document.image_1" [src]="document.image_1" class="image-1"  alt=""  />
 </div>

However, the alt attribute is displaying empty when it is exercising the articleImageAlt parameter when document.image_1_alttxt is empty. Does anyone know what should be the correct syntax for angular so that the alt will display properly? I am not sure if it has to do with 2 ngIf in the div block

Aucun commentaire:

Enregistrer un commentaire