Tommy1209
Tommy1209

Reputation: 189

Angular bootstrap modal

I'm using ui-bootstrap-tpl version 2.4.0 with Angular Dialog Service, and I have a problem with modal.

Problem occurs when I close modal:

Possibly unhandled rejection: cancel

Possibly unhandled rejection: backdrop click

Anyway to fix it? Thanks alot!

Upvotes: 3

Views: 602

Answers (1)

creimers
creimers

Reputation: 5303

You forgot to handle the dismiss case of the modal.

Here's an updated plunker: https://plnkr.co/edit/M5OnOcJJG65pinWe2iKt

Essentially, you need to do something like this:

dialog.result.then(
    function () {
        // success case
        console.log('ok');
    },
    function () {
        // dismiss case
        console.log('cancel');
    }
);

Upvotes: 3

Related Questions