1
我正在使用帶有Ionic 3的JavaScript並在iOS上工作。我正在嘗試實現一個警報與無線電選項供用戶選擇。Ionic 2/3如何訪問無線電提示中的值
我無法使用/訪問選定電臺值警報在下面的代碼:
let alert = this.alertCtrl.create({
title: 'Specify the reason',
inputs: [
{
type: 'radio',
label: 'label 1',
value: '0'
},
{
type: 'radio',
label: 'label 2',
value: '1'
}
],
buttons: [
{
text: 'Cancel',
role: 'cancel',
handler:() => {
console.log('Cancel clicked');
}
},
{
text: 'OK',
handler:() => {
console.log('OK clicked: ');
// I NEED TO GET THE VALUE OF THE SELECTED RADIO BUTTON HERE
}
}
]
});
alert.present();