Ionic framework 我们如何将值绑定到<;离子选择>;
我已经通过formController绑定了值,但它没有正确绑定, 这就是我如何绑定.ts文件上的值Ionic framework 我们如何将值绑定到<;离子选择>;,ionic-framework,ionic4,Ionic Framework,Ionic4,我已经通过formController绑定了值,但它没有正确绑定, 这就是我如何绑定.ts文件上的值 this.rental.setValue(scheme, { emitEvent: false, onlySelf: true }); 这是相关的HTML <ion-item> <ion-label position="floating"> SCHEME</ion-label> <ion-select placeholder="Sele
this.rental.setValue(scheme, { emitEvent: false, onlySelf: true });
这是相关的HTML
<ion-item>
<ion-label position="floating"> SCHEME</ion-label>
<ion-select placeholder="Select" formControlName="rental" interface="popover">
<ion-select-option *ngFor="let scheme of product" [value]="scheme">
<p class="color-gray font-12 text-align-right bold">
{{scheme.description}}
</p>
</ion-select-option>
</ion-select>
</ion-item>
计划
{{scheme.description}}
产品是一个对象数组在离子选择中也使用值标记
Ref:您还可以在ion select中使用ngModel标记,如
<ion-select placeholder="Select" [(ngModel)]="rental" interface="popover">
<ion-select-option *ngFor="let scheme of product" value="scheme">
<p class="color-gray font-12 text-align-right bold">
{{scheme.description}}
</p>
</ion-select-option>
</ion-select>
{{scheme.description}}