Hello please help me I work on an application with ionic 4 but I’m facing a problem my code, here is what I did in my provider file DialogService.ts
confirmDialog(tilte: string, msg: string): Promise<boolean> {
return new Promise((resolve, reject) => {
const confirm = this.alertController.create({
header: tilte,
message: msg,
buttons: [
{
text: 'Annuler',
role: 'cancel',
cssClass: 'secondary',
handler: () => {
confirm.dismiss().then(() => resolve(false));
return false;
}
}, {
text: 'Confirmer',
handler: () => {
confirm.dismiss().then(() => resolve(true));
return false;
}
}
]
});
return confirm.present();
});
}
and I execute it like this
this.dialogServ.confirmDialog('Passer une nouvelle commande?', 'Il n\'est paspossible de commander chez 2 restaurant a la fois').then((yes) => {
if (yes) {
}
});
But I still have the following errors in my command prompt
[ng] ERROR in src/app/pages/cart/cart.page.ts(27,90): error TS2304: Cannot find name 'UserP'.
[ng] src/app/services/DialogService.ts(32,37): error TS2570: Property 'dismiss' does not exist on type 'Promise<HTMLIonAlertElement>'. Did you forget to use 'await'?
[ng] src/app/services/DialogService.ts(38,37): error TS2570: Property 'dismiss' does not exist on type 'Promise<HTMLIonAlertElement>'. Did you forget to use 'await'?
[ng] src/app/services/DialogService.ts(45,28): error TS2570: Property 'present' does not exist on type 'Promise<HTMLIonAlertElement>'. Did you forget to use 'await'?
Help me please