Skip to content Skip to sidebar Skip to footer

Angularjs Treeview Using Ng-include Fires Ng-click For All Node's Parents

I want to write treeview using angularjs. I am using ng-include for recursive call..everything is fine except from ng-click..when each node is clicked..the hierarchy call is from c

Solution 1:

Try stopping event from bubble-ing up in the DOM tree.

In you ng-click:

ng-click='nodeSelected($event, category)'

In your controller:

$scope.nodeSelected = function($event, category){
    $event.stopPropagation();
    alert('This node is selected' + category.title);
}

Post a Comment for "Angularjs Treeview Using Ng-include Fires Ng-click For All Node's Parents"