added choice alert button
This commit is contained in:
parent
425f30a8eb
commit
86efbce55e
@ -44,20 +44,43 @@ export class AlertService {
|
|||||||
|
|
||||||
async presentAlert(header: any, message: any) {
|
async presentAlert(header: any, message: any) {
|
||||||
const alert = await this.alertController.create({
|
const alert = await this.alertController.create({
|
||||||
header: header,
|
header: header,
|
||||||
message: message,
|
message: message,
|
||||||
buttons: [
|
buttons: [
|
||||||
{
|
{
|
||||||
text: 'Ok',
|
text: 'Ok',
|
||||||
role: 'ok',
|
role: 'ok',
|
||||||
}
|
}
|
||||||
|
]
|
||||||
]
|
|
||||||
});
|
});
|
||||||
|
|
||||||
await alert.present();
|
await alert.present();
|
||||||
|
|
||||||
const { role } = await alert.onDidDismiss();
|
const { role } = await alert.onDidDismiss();
|
||||||
return role;
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user