js 1.3 with jquery. I have to display a form input in modal window. For which I have written a jquery function which will open the hidden dom content in Modal window.
ShowModal.open({
content: $(".modal_content").html(), //Get html content form dom
})
Code for modal is working fine. The problem is the modal is not getting the controller's scope. I am using "Controller As" syntax for controller:
function controller(){
bindVm = this;
bindVm.data = ["Hello", "World"]
}
In Modal window
<div ng-controller="controller as bindVm">
<div class="modal_content"> {{bindVm.data[0]}}</div>
</div>
The controller's code is working fine for normal page, but not working in modal window.
Note : I am also attaching html content using $compile
$modalContent.html($compile($modal_content)($scope));
Still not working. Anybody got something.