Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Hide modal on $scope $destroy #32

Closed
ProLoser opened this issue Dec 16, 2012 · 2 comments
Closed

Hide modal on $scope $destroy #32

ProLoser opened this issue Dec 16, 2012 · 2 comments

Comments

@ProLoser
Copy link
Member

So, lets say your modal is in a view or some other scenario where the scope can get destroyed. Lets say it was open, and one of the interactions with the modal causes the view to change.

What happens is that although the modal is gone, the overlay is still open, and since the modal DOM no longer exists on the page, you can't remove it.

I was trying to do something like this to repair this but was not working:

scope.$on('$destroy', function(){
  elm.modal('hide');
  model.$setViewValue(false);
});

http://plnkr.co/edit/MWEsWlJeeQJGJw0REnOD?p=preview

@ajoslin
Copy link
Contributor

ajoslin commented Dec 16, 2012

Good idea. We should add that in #25

@ajoslin
Copy link
Contributor

ajoslin commented Dec 31, 2012

This is actually not necessary with the new dialog provider, since it uses a new scope itself.

@ajoslin ajoslin closed this as completed Dec 31, 2012
codedogfish pushed a commit to codedogfish/angular-ui-bootstrap that referenced this issue Sep 15, 2015
Fixed: When an item that evaluates to false (such as "false" or "no") is...
karudedios pushed a commit to karudedios/bootstrap that referenced this issue Nov 18, 2020
Fix angular-ui#32 "grunt release" that do not convert HTML templates to js
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants