Ionic: how to handle change event radio button

I want to show alert dialog when I click some radio button. I try to use (change), (click) & (select) but still not working.
Please help me…

Tried this one? ionSelect - expression to be evaluated when selected

how to use that? sorry I newbie, I don’t understand

<ion-radio (ionSelect)="radioChecked()"....>
Then in your ts file you define a function radioChecked() that handles click on the radio.

4 Likes

Thank you. This is helpful. How can I get a radio button value passed back to the function, using this? Cheers.

<ion-radio (ionSelect)="radioChecked('YourValue')" ....>

@bpeary
You can send your desired value like this and then you can use it in your .ts file easily!!!

4 Likes

Thanks! That’s helpful information!

1 Like

You are welcome @bpeary :slight_smile:

1 Like

You can pass value just using $event instead of passing hard coded value
<ion-radio (ionSelect)=“radioChecked($event)” …>

1 Like