Open kpranjan1 opened 6 years ago
I've got the same error. It also happens when closing a confirm modal by "not confirming" (as in cancel).
I don't get the error. Hope this example helps: https://github.com/ashfaqch/angular-modal-dialog-example
This comes with Version 3.0.2 and I have Angular 4 if that helps.
Ahh, yes - per the example I was missing the onrejected
callback. Previously when I was getting error:
dialogRef.result.then((result) => {
if (result) {
alert(`The result is: ${result}`);
}
});
Simple adding the onrejected
callback prevents the error from occurring:
dialogRef.result.then((result) => {
if (result) {
alert(`The result is: ${result}`);
}
}, () => {
return;
});
Still though, you'd expect the library to check for the presence of a onrejected
callback before attempting to call it.
core.js:1350 ERROR Error: Uncaught (in promise): undefined at resolvePromise (zone.js:824) at resolvePromise (zone.js:795) at eval (zone.js:873) at ZoneDelegate.invokeTask (zone.js:425) at Object.onInvokeTask (core.js:4617) at ZoneDelegate.invokeTask (zone.js:424) at Zone.runTask (zone.js:192) at drainMicroTaskQueue (zone.js:602) at ZoneTask.invokeTask [as invoke] (zone.js:503) at invokeTask (zone.js:1540)