以下代码未正确过滤结果:
<input placeholder="search" type="text" ng-model="q">
<div ng-repeat="items in configuration.items | filter:{items.descr:q}">
<div>
<h3>{{items.descr}}</h3>
</div>
为什么呢?实际上这个代码在这个json对象$configuration
上完全不起作用:
{
"descr": "Project - Configuration",
"items": {
"dangerous_components": {
"descr": "Warning stuffs",
"items": {
"electrical_components": {
"descr": "electrical components here",
"values": [{
"key": "NOT_APPLICABLE",
"label": "N/A",
"svalue": null
}]
}
}
}
}
}