Note: If you are having problems formatting your issue please refer to this article on using markdown in Github:
https://guides.github.com/features/mastering-markdown/
Note: for support questions, please use one of these channels:
https://forum.ionicframework.com/
http://ionicworldwide.herokuapp.com/
Steps to reproduce:
insert any relevant code between the above and below backticks
Other information: (e.g. stacktraces, related issues, suggestions how to fix, stackoverflow links, forum links, etc)
Which Ionic Version? 1.x or 2.x
For Ionic 1 issues - http://plnkr.co/edit/Xo1QyAUx35ny1Xf9ODHx?p=preview
For Ionic 2 issues - http://plnkr.co/edit/me3Uk0GKWVRhZWU0usad?p=preview
Run ionic info
from terminal/cmd prompt: (paste output below)
The Ionic Select component does not emit a change
event, but it does emit an ionChange
event. Please refer to the Output Events section in the API documentation to find the Select component's events. Thanks!
IonChange is working for me. Thank you Brandy.
Thanks Brandy.
Use this:
(ngModelChange)="someEvent($event)"
this works just fine if u are using [(ngModel)] for the
So why is this gone from the documentation?
https://i.imgur.com/sPTdT6x.png
@azarus Nice catch, they must have accidentally been undocumented. I've created an issue to get them added back here: https://github.com/driftyco/ionic-site/issues/1074
Still, it's not there.Can you please tell me the place to find the detail of ionChange
event? @brandyscarney
You can use it the following way:
<ion-select [(ngModel)]="gender" (ionChange)="onSelectChange($event)">
<ion-option value="f">Female</ion-option>
<ion-option value="m">Male</ion-option>
</ion-select>
then in your page:
onSelectChange(selectedValue: any) {
console.log('Selected', selectedValue);
}
This will be called every time the value of the select changes.
Yes, I know about that part.But I would like to use the real data type instead of any
here selectedValue: any
.Can you please tell me the data type of $event
? @brandyscarney
Thanksa lot!! It is not in the documentation at this moment.
i would like to pass my department Id to Item change how can i trigger item id (ionChange)="onSelectedItem(item.Id)"..im getting undefined value please help me on this
how can i get text of ion-select i don麓t know how to use attribute selectedtext
wow, this is a long time to leave ionChange undocumented.
ion-option should be listening for a status change when attribute "multiple" on select is set to true.
why $event = selected value? ($event.target.checked)
i need the $event object itself! ($event.stopPropagation() and stuff)
I am going to be locking this issue as the comments have strayed from the main issue which was resolved.
If you have concerns about the documentation please leave comments/reactions on the site issue: https://github.com/ionic-team/ionic-site/issues/1074
If you have questions on how to use the select component please view the API documentation and then ask on our forum or slack channel.
If you've found a bug or believe there should be a change to the select component please create a new issue on this repository and fill out the pre-populated template.
Thank you! 馃檪
Most helpful comment
The Ionic Select component does not emit a
change
event, but it does emit anionChange
event. Please refer to the Output Events section in the API documentation to find the Select component's events. Thanks!