如何在多级对象的多ngModel
循环中使用ngFor
?
<div no-padding *ngFor="let addon of item.addons_list; let mainIndex= index">
<div *ngIf="addon.has_sub">
<ion-row *ngFor="let sub of addon.sub_list ; let sub1 = index">
<ion-col col-12 no-padding>
<ion-select dir="rtl" placeholder="{{ sub.name }}" [(ngModel)]="add[mainIndex][sub1]">
<ion-option value="{{ch.id}}" *ngFor='let ch of sub.items'> {{ch.name}} </ion-option>
</ion-select>
</ion-col>
</ion-row>
</div>
</div>