我正在使用所选键在ion-select-option上编写逻辑,这将基于for循环的ID以及我身边存储的数据
<ion-label class="label-md-h" position="floating">Water irrigation type</ion-label>
<ion-select required [(ngModel)]="zone.zoneType" name="zoneType" #zoneType="ngModel"
placeholder="Water irrigation type" (ionChange)="onZoneTypeChange()">
<ion-select-option *ngFor="let head of headTypes" selected="head.id === zone.zoneType.id" [value]="head">
{{head.name}} {{head.durationMins}}m
</ion-select-option>
预期结果:必须选择值 实际结果:什么都没选择