[Fixed] Check is even ngFor angular 4


I have the bellow code to display two images in a single row.but the checking *ngIf="even" was not working .What is wrong with this?

 <div *ngFor="let narative_image of narative_images;let i = index;">
       <ion-row *ngIf="even" >
             <img  style="width: 100%; height: auto;"   src="{{narative_image[i].thumbimg}}" />
              <img  style="width: 100%; height: auto"  src="{{narative_image[i+1].thumbimg}}" />


Define ‘even’

<div *ngFor="let n of narative_images;let i = index; let even = even">

More info here.

Leave a Reply

(*) Required, Your email will not be published