bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

bug(modal): cannot close from custom directive

Open moroshko opened this issue 13 years ago • 4 comments

For some reason, the modal is not closed from custom directive: http://stackoverflow.com/a/17025757/247243

Is this a bug?

moroshko avatar Jun 10 '13 22:06 moroshko

@moroshko Tried to look at your code but I've got allergy to coffee I'm afraid so it is hard for me to jump in.

Most importantly, for this type of wrapping you should use the $dialog service instead of the modal directive - it is far better suited for this type of customization tasks. Have a look at the messageBox from this project to see what I mean.

Also, you've got way to many dependencies, this project doesn't need jQuery not bootstrap's JavaScript. Pure power of AngularJS directives without any 3rd party dependencies.

If you are willing to convert your example to JavaScript and put it into http://plnkr.co/ I will be happy to help more.

pkozlowski-opensource avatar Jun 11 '13 17:06 pkozlowski-opensource

@pkozlowski-opensource Here is the JavaScript version of it: http://plnkr.co/edit/4VGWikiWNmW56YX6PHnE?p=preview I removed also jQuery and Bootstrap's JS from the example. For some reason, the modals are not hidden by default, as opposed to the CoffeeScript example. Anyway, the core issue is still there: $scope.confirmationDialog = false; doesn't close the modal. I'll have a look how this can be done with $dialog instead, but I would still be very interested to get to the bottom of this issue. Thanks a lot for your help!

moroshko avatar Jun 11 '13 23:06 moroshko

@mororshko @pkozlowski-opensource I've got exactly the same problem. Trying to use a model dialog for confirmation before deleting an item but the dialog won't close afterward.

lasimon avatar Jul 14 '13 20:07 lasimon

@moroshko @lasimon the $dialog service was just re-written as $modal in d7a48523e437b0a94615350a59be1588dbdd86bd. Check the docs at https://github.com/angular-ui/bootstrap/blob/master/src/modal/docs/readme.md, give it a try and come back to us if you've got further questions.

pkozlowski-opensource avatar Aug 24 '13 16:08 pkozlowski-opensource