将离子选择选项传递给功能-离子4
问题描述:
我有这个Ionic
版本4代码,该代码只是试图获取所选值并将其传递给组件中的函数:
I have this Ionic
version 4 code that is simply trying to take a the selected value and pass it to a function in it's component:
<ion-item>
<ion-label>Convert Currency</ion-label>
<ion-select [(ngModel)]="currency">
<ion-select-option *ngFor="let c of currencyData" [value] = "c" >{{c.text}}</ion-select-option>
</ion-select>
我尝试了onChange
,但显然不在版本4中.
I tried onChange
but that is apparently not in version 4.
答
您正在寻找 ionChange
<ion-select [(ngModel)]="currency" (ionChange)="yourFunction($event)">