diff --git a/src/modal/docs/readme.md b/src/modal/docs/readme.md index 27904f5699..46cbbb18b7 100644 --- a/src/modal/docs/readme.md +++ b/src/modal/docs/readme.md @@ -35,7 +35,7 @@ In addition the scope associated with modal's content is augmented with 2 method Those methods make it easy to close a modal window without a need to create a dedicated controller. -If the $scope is destroyed via unexpected mechanism, such as it being passed in the modal options and a $route/$state transition occurs, the modal will be dismissed with the value `$uibModal`. +If the $scope is destroyed via unexpected mechanism, such as it being passed in the modal options and a $route/$state transition occurs, the modal will be dismissed with the value `$uibUnscheduledDestruction`. Finally, a `modal.closing` event is broadcast to the modal scope before the modal closes. If the listener calls preventDefault on the event, then the modal will remain open. The $close and $dismiss methods return true if the diff --git a/src/modal/modal.js b/src/modal/modal.js index 89ab44134c..1fdfad3af8 100644 --- a/src/modal/modal.js +++ b/src/modal/modal.js @@ -528,7 +528,7 @@ angular.module('ui.bootstrap.modal', []) modalScope.$on('$destroy', function() { if (!modalScope.$$uibDestructionScheduled) { - modalScope.$dismiss('$uibModal'); + modalScope.$dismiss('$uibUnscheduledDestruction'); } });