Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 228595

Handle radio values

$
0
0

Being new to Ionic 2, I can't quite figure out how to get the values from a radio button.

in the template I have

<ion-list radio-group>
<ion-item>
<ion-label>I am acting on behalf of myself</ion-label>
<ion-radio checked="true" value="self"></ion-radio>
</ion-item>
<ion-item>
<ion-label>I am acting as an agent</ion-label>
<ion-radio value="agent"></ion-radio>
</ion-item>
</ion-list>
<button full (click)="handleResult()">OK</button>

And in the JS,

handleResult() {
// access ion-radio items and check which value is checked
}

Can someone put me on the right path here please.

Thanks


Viewing all articles
Browse latest Browse all 228595

Trending Articles



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