在HTML模板我有指令ng-repeat
:爲什麼不過濾Angular JS?
<div ng-repeat="friend in friendList.active | filter:searchName">
而且輸入字段ng-model="searchName"
:
<input type="text" ng-model="searchName" maxlength="10" placeholder="">
當我鍵入內部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}}
需要更多代碼。控制檯中的錯誤? – dfsq 2015-04-05 21:25:16
我想你錯過了爲輸入設置名稱,你將設置名稱後,它應該工作 – 2015-04-05 21:26:08
有沒有錯誤。設置屬性'name =「searchName」'? – Sahe 2015-04-05 21:27:54