Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught error when removing the result object from the close function #880

Closed
NetanelBasal opened this issue Oct 13, 2016 · 1 comment
Closed

Comments

@NetanelBasal
Copy link

NetanelBasal commented Oct 13, 2016

When I remove the result object from the modal.open function and then closing the modal I get this error:

    Uncaught (in promise): 0
    at resolvePromise (VM333 zone.js:429)
    at NgbModalRef._reject (VM333 zone.js:406)
    at NgbModalRef.dismiss (VM364 ng-bootstrap:3078)
    at eval (VM364 ng-bootstrap:3058)
    at SafeSubscriber.schedulerFn [as _next] (VM360 core.umd.js:5987)
    at SafeSubscriber.__tryOrUnsub (VM370 Subscriber.js:223)
    at SafeSubscriber.next (VM370 Subscriber.js:172)
    at Subscriber._next (VM370 Subscriber.js:125)
    at Subscriber.next (VM370 Subscriber.js:89)
    at EventEmitter.Subject.next (VM366 Subject.js:55)

Note:
It's happening when clicking the backdrop and only at the first time. open the plunker and watch the console.

This is working plunker -
plunker

@pkozlowski-opensource
Copy link
Member

The error you are seeing in the console is the one from a browser indicating that a promise was rejected and there was no handler for it. So in this sense it works as expected - you need to handle a promise if you don't want to see the default error for an unhandled promise rejection.

Having said the above I can see how it could be annoying to be forced to add a promise handler even if you don't care about results. As such we should add a default (noop) error handler.

It is (most probably) a very easy fix to be done here so PRs are welcomed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants