[SOLVED] ([ngModel]) and ngFor and concat

Hello everyone.

I have this model :

public attrs_right = {
    attr1_right : "",
    attr2_right : "",
    attr3_right : ""
  };

This 3 “Attrs” are optionnal .I can have for example :

  • attr1_right and attr3_right available
  • attr2_right only etc etc

On my page I want to bind this model on an ion-select

<ion-item no-lines *ngFor="let attr of availableAttrs.getEntries()">
        <ion-label>{{attr.key}}</ion-label>
        <ion-select  ([ngModel])=" 'attrs_right.' + attr.key+ '_right' " >
          <ion-option *ngFor="let option of attr.value.toArray()" [value]="option">{{option}}</ion-option>
        </ion-select>
</ion-item>

My major probleme is to concat in ([ngModel]) … :frowning:
Any help would be very appreciated
Thanks in advance

[solved] => found a better way with Reactive Form :

<ion-item no-lines *ngFor="let attr of availableAttrs.getEntries()">
        <ion-label>{{attr.key}}</ion-label>
        <ion-select [formControlName]="attr.key+'_right'">
          <ion-option *ngFor="let option of attr.value.toArray()" [value]="option">{{option/100}}</ion-option>
        </ion-select>
      </ion-item>