Using the example mentioned here, how can I invoke the modal window using JavaScript instead of clicking a button?
I am new to AngularJS and tried searching the docu
I liked the answer but the part that bothered me was the use of as a container for the modal's template.
I wanted to place the modal's template in a hidden this variable will be used when calling in order to bind the inner html, i created check out the example plunkermodal_html_template
mainly because i think it more correct (and more comfortable to process in WebStorm/PyCharm) to place the template's html inside a
$modal({... 'template': $scope.modal_html_template, ...})inner-html-bind which is a simple directiveI'm a modal!
inner-html-bind directive:app.directive('innerHtmlBind', function() {
return {
restrict: 'A',
scope: {
inner_html: '=innerHtml'
},
link: function(scope, element, attrs) {
scope.inner_html = element.html();
}
}
});