【发布时间】:2018-08-16 06:13:48
【问题描述】:
我正在关注链接https://wix.github.io/angular-tree-control/ 以探索角度树控件的不同功能。从文档中无法正确理解我应该为过滤器比较器和过滤器表达式提供什么值以使其工作以过滤节点。下面是代码:
<body ng-app="app">
Search: <input ng-model="searchTree">
<table id="searchTextResults">
<tr><th>Name</th><th>Age</th></tr>
<tr ng-repeat="data in dataForTheTree | filter:searchTree">
<td>{{node.name}}</td>
<td>{{node.age}}</td>
</tr>
</table>
<div ng-controller="myController">
<treecontrol class="tree-light"
tree-model="dataForTheTree"
filter-expression="data"
filter-comparator="false"
options="treeOptions"
on-selection="showSelected(node)"
selected-node="node1"> {{node.name}} age {{node.age}}
</treecontrol>
</div>
</body>
plunkr 的完整链接:https://plnkr.co/edit/bQHOIQ2HDPr4WJaukB8I?p=preview
【问题讨论】:
-
找到了答案。
标签: angularjs treecontrol