How to use ion-select in ngfor loop

i tried to rename [(ngModel)] using loop index i got Error: Cannot assign to a reference or variable!

 <ion-row class="product-row active" *ngFor="let item of griddata;let i = index" align-items-center>
              <ion-col col-4 >
                  <ion-thumbnail item-start>
                <img src="http://localhost/smartvege/adminpanel/Assets/images/{{ item.image }}">
                <ion-icon name="done-all"></ion-icon>

              <ion-col col-8>
                  <h2>{{ item.title }} <span>- {{ item.titleurdu }}</span></h2>
                  <p>{{ item.saleprice }} - per {{ item.unit }}</p>  
                  <ion-item class="grid-quantity">
                      <ion-select [(ngModel)]="'test'+i" >
                        <ion-option *ngFor="let qtys of item.availableQTY.split(',')" value="{{qtys}} {{ item.unit }}">{{qtys}} {{ item.unit }} </ion-option>

1 Like

I would make the thing you are binding to a property of each item.

please let me know where is my mistake. i want to add diffrent ngModel name of each index