i have this alertCtrl and i want to use it as a service, my idea is send 3 params to this alert, header, text and a function, this function will be fired when the user press the Ok button, i tryid to send params like this but this doesnt work.
this is my code:
async showMessage(header,message, function){
let alert = await this.alertCtrl.create(
{
header: header,
message: message,
buttons: [
{
text: 'Cancel'
},
{
text: 'Ok',
handler: () => {
function // i want to fire a function here
}
}
]
});
await alert.present();
}
thanks in advance.
greetings