I am trying to convert this ionic 3 code into ionic 4 but I don't know how the promise works on ionic 4. I tried looking into the documentations and I can't find any solutions to promises
async generateAlert(header, message, ok, notOk): Promise<boolean> {
return new Promise((resolve, reject) => {
let alert = await this.alertController.create({
header: header,
message: message,
buttons: [
{
text: notOk,
handler: _=> reject(false)
},
{
text: ok,
handler: _=> resolve(true)
}
]
})
await alert.present();
});
}