I am working with the Ionic (angular) framework and I need to extract information from the alert-controller inputs in order to utilize them within a function. Is there a method for accomplishing this?
async presentAlertPrompt(resp) {
const alert = await this.alertController.create({
cssClass: 'my-custom-class',
header: 'Update!',
inputs: [
{
type: 'text',
value: resp.food_name,
},
{
type: 'text',
value: resp.food_price
},
// multiline input.
{
type: 'textarea',
value: resp.food_description
}
],
buttons: [
{
text: 'Cancel',
role: 'cancel',
cssClass: 'secondary',
handler: () => {
console.log('Confirm Cancel');
}
}, {
text: 'Ok',
handler: () => {
console.log('Confirm Ok');
})
}
}
]
});
await alert.present();
}