我正在跟踪链接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
答案 0 :(得分:0)
在这里我们可以使用filter-expression
就像ng-repeat | filter:{}
选项
filter-expression="{filterable column: ng-model name}"
ex - filter-expression="{name: searchByName}"
我们可以使用
filter-comparator="true"
filter-comparator="false"