Ionic: Can't dismiss Alert when displayed after Confirm

I want to show an alert box after a confirm box. For example, prompt the user for confirmation before deleting, and then show the result of the call to the web service.

In the example below, the first Alert.create is presented for the confirmation. If the user clicks Yes, then the web service call is made and then I show another Alert.create.

The problem is that the second alert cannot be dismissed.

I know I should wait for the first confirm to completely go away before showing the alert results, but Iā€™m not sure how to do that correctly. Thoughts?

Perhaps this comment might help?

1 Like

That did help. The trick was to create the confirm dialog as a variable outside the nav.present().

Then inside the ok click handler, call confirm.dismiss().then(ā€¦).

Working plunker here:

1 Like

Hello i was using your solution but i keep getting property present does not exist on type navcontroller on present how did you fix that ?