ezraroi / ngJsTree

Angular Directive for the famous JS Tree
http://ezraroi.github.io/ngJsTree/
MIT License
270 stars 101 forks source link

Node click event #82

Closed JasonCSharpCoder closed 8 years ago

JasonCSharpCoder commented 8 years ago

how to config or code a click event function for the tree node? thks!

charon4ever commented 8 years ago

I have the same question.How to add a click event on the node of the tree?

ezraroi commented 8 years ago

you have the event of the js tree. Please check the js tree docs: https://www.jstree.com/api/#/

migarc1 commented 7 years ago

As ezraroi mentions, first, you need to check the events list. Then, you have to put it as follows:

In the HTML file: < js-tree="treeConfig" tree-events="select_node:selectNode;open_node:openNode" />

In the Controller: $scope.selectNode = function(node, selected, event){ console.log(selected); }

$scope.openNode = function(node){ console.log(node); }