added choice alert button

This commit is contained in:
Ryan Bakkes 2021-12-30 03:12:17 +01:00
parent 425f30a8eb
commit 86efbce55e

View File

@ -44,20 +44,43 @@ export class AlertService {
async presentAlert(header: any, message: any) {
const alert = await this.alertController.create({
header: header,
message: message,
buttons: [
{
text: 'Ok',
role: 'ok',
}
]
header: header,
message: message,
buttons: [
{
text: 'Ok',
role: 'ok',
}
]
});
await alert.present();
const { role } = await alert.onDidDismiss();
return role;
}
}
async presentAlertConfirm(header: any, message: any, button1: any, button2: any) {
const alert = await this.alertController.create({
header: header,
message: message,
buttons: [
{
text: button1,
role: button1,
},{
text: button2,
role: button2
}
]
});
await alert.present();
const { role } = await alert.onDidDismiss();
return role;
}
}