I have AlertService which calls AlertController, and alertController has this method,
async presentAlertPrompt() {
const alert = await this._alertController.create({
cssClass: 'my-custom-class',
header: 'Add Comment!',
inputs: [
{
name: 'comment',
type: 'textarea',
placeholder: 'Comment'
}
],
buttons: [
{
text: 'Cancel',
role: 'cancel',
cssClass: 'secondary',
handler: () => {
console.log('Confirm Cancel');
}
}, {
text: 'Ok',
handler: (alerData) => {
return alertData
}
}
]
});
await alert.present();
}
and once i invoke this method in another component and,
this._alert.presentAlertPrompt().then((data) => {
console.log('Alert respone',data)
})
alertData
is empty, what i'm doing wrong here ?