eu81273 / angular.treeview

AngularJS based Treeview (no jQuery)
MIT License
405 stars 223 forks source link

Use controller to select a Node #17

Closed Dorianux closed 10 years ago

Dorianux commented 10 years ago

How can i use a controller to select a Node (instead of clicking to select)?

I tried to set currentNode and hoped that it will trigger $scope.$watch, but it does not.

Dorianux commented 10 years ago

To correct myself: Setting tagtree.currentNode does trigger $scope.$watch('tagtree.currentNode', ...., still the visual selection is not updated in the view.

Dorianux commented 10 years ago

Found it: simply set: selected=True on the currentNode!

schitupolu commented 10 years ago

Hi,

I am also trying to pre-select. Can you please let me know where you added selected=True? When i try adding it on the currentNode doesn't highlight it in the html.