Angularjs 为什么不过滤角JS?

Angularjs 为什么不过滤角JS?,angularjs,Angularjs,在HTML模板中,我有指令ng repeat: <div ng-repeat="friend in friendList.active | filter:searchName"> 当我在ng repeat中键入文本块时,没有排序,为什么 响应friendList.activeAJAX是: {"534":{"name":"Danil","photo":"http://who.com/public/images/non_photo_user.png","id":"534","unrea

在HTML模板中,我有指令
ng repeat

<div ng-repeat="friend in friendList.active | filter:searchName">
当我在
ng repeat
中键入文本块时,没有排序,为什么

响应
friendList.active
AJAX是:

{"534":{"name":"Danil","photo":"http://who.com/public/images/non_photo_user.png","id":"534","unread":null,"online":0},"541":{"name":"Aysel Bukarova","photo":"http://who.com/public/images/non_photo_doctor.png","id":"541","unread":null,"online":0}}

您需要转换数组中的响应对象,因为筛选器正在使用数组。或者,您可以编写自己的过滤器来处理对象的属性。请参见上升分类账中的示例。输入字段的名称不是必需的。

需要更多代码。控制台出错?我想您没有设置输入的名称,在设置名称后,应该没有错误。设置属性
name=“searchName”
?也不起作用。如果显示do{{searchName}}。请检查此示例:谢谢,我接受您的答案是解决方案。我已转换并完成所有工作。如果不需要索引(您在每个项目中都有一个“id”),则可以在服务器端转换对象。
{"534":{"name":"Danil","photo":"http://who.com/public/images/non_photo_user.png","id":"534","unread":null,"online":0},"541":{"name":"Aysel Bukarova","photo":"http://who.com/public/images/non_photo_doctor.png","id":"541","unread":null,"online":0}}