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

How to close dialog opened by openConfirm #600

Open
JeffinBao opened this issue Sep 20, 2019 · 1 comment
Open

How to close dialog opened by openConfirm #600

JeffinBao opened this issue Sep 20, 2019 · 1 comment

Comments

@JeffinBao
Copy link

Since openConfirm() returns a promise, I can not get dialog id as open() method returning an object. Then how can I only close the dialog created by openConfirm() method in JS? I've tried a lot of approaches, all of them didn't work.

@JeffinBao
Copy link
Author

I found one working approach which is to register an event listener and record the dialog id. This approach was found in the documentation.

$rootScope.$on('ngDialog.opened', function (e, $dialog) {
console.log('ngDialog opened: ' + $dialog.attr('id'));
});

However, I wonder if there is another way to close the dialog opened by openConfirm() method? By the way, I am opening the dialog in an interceptor, not a controller. Any idea would be appreciated. Thanks!

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

No branches or pull requests

1 participant