Hi all ,
I am getting following error , while trying to handle double dimensional array in ionic2
Error is as follows
Error: Uncaught (in promise): Error: Template parse errors:
**Parser Error: Bindings cannot contain assignments at column 20 in [**
{{
gift1 = giftRecord[0];
gift2 = giftRecord[1];
}}
** ] in ng:///RedeemModule/Redeem.html@18:49 ("**
<ion-grid>
<ion-row *ngFor="let giftRecord of giftAll" >[ERROR ->]
{{
gift1 = giftRecord[0];
gift2 = giftRecord[1];
"): ng:///RedeemModule/Redeem.html@18:49
My html template is as follows
<ion-grid>
<ion-row *ngFor="let giftRecord of giftAll" >
{{
gift1 = giftRecord[0];
gift2 = giftRecord[1];
}}
<ion-col col-3>
<img src=
</ion-col>
<ion-col col-3>
</ion-col>
</ion-row>
</ion-grid>
I am able to print 2 dimensional file in my ts file though with same syntax
for ( let newgift of this.giftsAll)
{
rowNo += 1;
let gift1 = newgift[0] ;
let gift2 = newgift[1];
console.log( "row : "+rowNo );
if (gift1 != null)
{
console.log(gift1.giftCode);
}
if (gift2 != null)
{
console.log(gift2.giftCode);
}
}
Please suggest.