Hi,
The quantity value is not getting bind in ngModel. can anyone tell how to bind quantity field and get user entered value on dismiss of alert?.
thanks in advance
async presentAlertPrompt() {
this.quantity = 0;
const alert = await this.alertController.create({
cssClass: 'my-custom-class',
header: 'Prompt!',
mode: 'ios',
message: new IonicSafeString(`<ion-list><ion-item><ion-label position="stacked"><span>${this.cs.GlobalValue.quantity}</span></ion-label>
<ion-input type="number" placeholder="enter quantity" min=0 [(ngModel)]="quantity"></ion-input></ion-item></ion-list>`),
buttons: [
{
text: 'Cancel',
role: 'cancel',
cssClass: 'secondary',
handler: () => {
console.log('Confirm Cancel');
}
}, {
text: 'Ok',
handler: (event) => {
console.log(this.quantity);
}
}
]
});
await alert.present();
alert.onDidDismiss().then(res => {
console.log(this.quantity)
})
}
1 post - 1 participant