Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pass ion-select-option to function - 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>

I tried onChange but that is apparently not in version 4.

like image 733
ecain Avatar asked Dec 04 '22 19:12

ecain


1 Answers

You are looking for ionChange

  <ion-select [(ngModel)]="currency" (ionChange)="yourFunction($event)">
like image 78
Sajeetharan Avatar answered Jan 11 '23 07:01

Sajeetharan