Open ThCC opened 10 years ago
Just use Angular's filter system when specifying the nodes for the tree. Using the sample template as an example:
<ul frang-tree>
<li frang-tree-repeat="node in treeData | filter:myFilter">
<div><span class="icon"
ng-class="{collapsed: node.collapsed, expanded: !node.collapsed}"
ng-show="node.children && node.children.length > 0"
ng-click="node.collapsed = !node.collapsed"></span>
<span class="label"
ng-class="{folder: node.children && node.children.length > 0}"
ng-bind="node.label"
ng-click="action(node)"></span>
</div>
<ul ng-if="!node.collapsed && node.children && node.children.length > 0"
frang-tree-insert-children="node.children | filter:myFilter"></ul>
</li>
</ul>
How to filter an element in the tree?