In a controller B ("templates / menu_lateral.html"), I am generating dynamic content, in itself, I am generating a list and I add an ng-click and the class ".items", and from another controller A, It does not seem to recognize the function.
if I put this content in the A driver
$(document).on("click", ".items", function() {
var valor=$(this).attr("include"); //tengo un attr llamado include con un valor para saber que template usar
$scope.oIncludes={
"tecnico": "templates/dashboard.html",
"historia": "templates/historia_dos.html"
}
$scope.include=$scope.oIncludes[valor];
})
$scope.include="templates/dashboard.html";
By default, use the template, "templates / dashboard.html"; But with that click event, despite belonging to another controller, the class "items" is detected, but the ng-include, is never updated. What can I do?
This is the main controller template
<div ng-include="'templates/menu_lateral.html '"></div>
<div ng-include="include" ></div>