From eb4becf69e86140768e3ca188b2df3723e31f197 Mon Sep 17 00:00:00 2001 From: hussainb Date: Sat, 18 Jul 2015 10:39:10 +0530 Subject: [PATCH] Fix to support dynamically created modal parent. Support getting modal parent element across page changes. --- modal.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modal.js b/modal.js index ae1f50d..29ba4f3 100644 --- a/modal.js +++ b/modal.js @@ -19,7 +19,7 @@ function modalFactoryFactory($animate, $compile, $rootScope, $controller, $q, $h var template = config.template, controller = config.controller || null, controllerAs = config.controllerAs, - container = angular.element(config.container || document.body), + container = config.container || document.body, element = null, html, scope; @@ -65,7 +65,7 @@ function modalFactoryFactory($animate, $compile, $rootScope, $controller, $q, $h } } $compile(element)(scope); - return $animate.enter(element, container); + return $animate.enter(element, angular.element(container)); } function deactivate () { @@ -90,4 +90,4 @@ function modalFactoryFactory($animate, $compile, $rootScope, $controller, $q, $h active: active }; }; -} \ No newline at end of file +}