3

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:

  • If I click OK, it closed and no error.
  • If I click Cancel, it closed but have an error in console window:

Possibly unhandled rejection: cancel

  • If I click outside modal, it closed but have an error:

Possibly unhandled rejection: backdrop click

Anyway to fix it? Thanks alot!

1

1 Answer 1

3

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');
    }
);
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks alot! Very helpful!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.