【发布时间】:2019-09-08 13:35:46
【问题描述】:
我正在尝试从 ion-select 中获取选定的选项值 但是当我从 ion-select 中选择任何值时,我会得到未定义的值,因为我是 ionic 4 的新手。 我无法自行排序。
<ion-item>
<ion-label>Country</ion-label>
<ion-select formControlName="country" (ionChange)="countryChange($event)" >
<ion-select-option *ngFor="let country of countries" [value]="country.value">{{country.name}}</ion-select-option>
</ion-select>
</ion-item>
home.page.ts 文件
countryChange(country : Country) {
console.log(country.id) ;
}
【问题讨论】:
标签: ionic4