Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70612

Getting the selected value of a select by an event

$
0
0

@iborik wrote:

Hello,

I have a setting page and I want to allow my users to change the app's language.

How can i get the selected value of a <ion-select> please ?
I need something like an event.

Settings.html
`

      <ion-label>Langue</ion-label>

      <ion-select multiple="false" cancelText="{{'BUTTONS.CANCEL' | translate}}"
                  [(ngModel)]="userLang"
                  [alertOptions]="alertOptions">

        <ion-option *ngFor="#lang of availableLang" value="{{lang.short}}" [checked]="lang.short == userLang">{{lang.value}}</ion-option>

      </ion-select>

`

I tried with [change]="func(userLang)" like said here (go below) but I have a problem with that, that triggers my function several times in one click.
Do you have an alternative solution for me please ?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70612

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>