将离子选择选项传递给功能-离子4 [英] Pass ion-select-option to function - Ionic 4

查看:51
本文介绍了将离子选择选项传递给功能-离子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)">

这篇关于将离子选择选项传递给功能-离子4的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆