Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to close a ngDialog from angular controller

Tags:

ng-dialog

I need to open multiple ngDialog with same id, when clicking the close button it should close only the currently opened ngDialog.

For closing ngDialog I need to call one event which collects the data then closes the ngDialog.

like image 561
user2021347 Avatar asked Dec 10 '22 19:12

user2021347


1 Answers

It depends if you're trying to close it (1) from its own controller, or (2) the controller that instantiates it:

(1) From its own controller:

scope.closeThisDialog(value);

see doc: https://github.com/likeastore/ngDialog

(2) From controller that instantiates it:

var dialog = ngDialog.open(); 
// for closing the dialog call dialog.close()

As mentioned by Satish Salvador's response.

Cheers!

like image 91
mika Avatar answered Feb 12 '23 19:02

mika