【发布时间】:2014-07-31 09:26:03
【问题描述】:
这是我的 json:
[{"node":
{'name': 'Nexus S',
'snippet': 'Fast just got faster with Nexus S.',
'age': 1}},
{"node":{'name': 'Motorola XOOM™ with Wi-Fi',
'snippet': 'The Next, Next Generation tablet.',
'age': 2}},
{"node":{'name': 'MOTOROLA XOOM™',
'snippet': 'The Next, Next Generation tablet.',
'age': 3}}
];
这是我的代码:
Search-title: <input type='text' ng-model="name">
<div class='cat' ng-repeat="(key,value) in phones ">
<ul ng-repeat="fin in value | filter:name ">
<li><h3>{{fin.name}}</h3>
{{fin.snippet}}
</li>
</ul>
</div>
如何为这个 json 对象应用过滤器?
【问题讨论】:
标签: javascript angularjs angularjs-ng-repeat angularjs-filter