javascript - Directives as class in bootstrap ui modal do not compile -
i'm trying pass directive class in windowclass field doesn't seem compiled , therefore directive not called.
modal:
... $modal.open({ templateurl: 'modal.html', scope: scope, controller: 'myctrl controller', backdrop: false, windowclass: 'directive' }) .result.then(function (data) { // }); ...
directive:
... .directive('directive', function() { return { link: function(scope, element, attr) { var modal = element; console.log("directive called"); // real code goes there } }; }); ...
with configuration, directive never gets called.
i'm using workaround @ moment not satisfied it:
directive:
... .directive('directive', function() { return { link: function(scope, element, attr) { var modal = element.parent().parent().parent(); console.log("directive called"); // real code goes there } }; }); ...
modal.html:
<div directive> <!-- --> </div>
i found same question here doesn't have answer other workaround, reposting appropriate tag: angular-ui-bootstrap specified on github repo, hoping receive better answer.
i using:
- angular v1.3
- angular-ui/bootstrap v0.13.0 (last version)
update: please see comment below.
currently, not recompile element. rather, call $element.addclass
, pass in user's specified value of windowclass
.
however, think there use case , please enter new issue here if don't mind.
please link post new issue. thanks.
Comments
Post a Comment