I am adding Angular directive content dynamically, but I'm not able to add functionality like $scope and Controller inside it. How do I solve this issue? For example:
a.html
<div ng-controller="actrl">{{aname}}</div>
b.html
<div ng-controller="bctrl">{{bname}}</div>
Suppose that I have a directive with the template URL: /a.html and
I change it to /b.html dynamically, then for b.html, the angular functionalities (bctrl) are not working.
jQuery
jQuery.ajax({
url: menu.templateUrl,
success: function(response) {
jQuery("view-partial").html(response);
}
});