Skip to content

Commit db74c1f

Browse files
committed
When scope of modal gets destroyed, also remove the modal from the DOM.
1 parent 97a5ad8 commit db74c1f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/modal/modal.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ angular.module('angularify.semantic.modal', [])
2020
}, function (modelValue){
2121
element.modal(modelValue ? 'show' : 'hide');
2222
});
23+
scope.$on('$destroy', function() {
24+
element.remove();
25+
});
2326
}
2427
}
2528
});

0 commit comments

Comments
 (0)