diff --git a/src/modal/modal.js b/src/modal/modal.js index 11a5424152..1ce073dbd2 100644 --- a/src/modal/modal.js +++ b/src/modal/modal.js @@ -134,13 +134,14 @@ angular.module('ui.bootstrap.modal', []) $modalStack.open = function (modalInstance, modal) { var backdropDomEl; - var modalDomEl = $compile(angular.element('').html(modal.content))(modal.scope); - body.append(modalDomEl); - if (modal.backdrop) { backdropDomEl = $compile(angular.element(''))($rootScope); body.append(backdropDomEl); } + var modalDomEl = $compile(angular.element('').html(modal.content))(modal.scope); + body.append(modalDomEl); + + openedWindows.add(modalInstance, { deferred: modal.deferred,