轻轻问 ng-repeat filter的问题
小弟 刚学 请问 我这个自己写的filter为什么不起作用<ion-item class="item-remove-animateitem-icon-right"ng-repeat="bookList in func() "
id="{{ bookList.address_key}}">
<h2>{{bookList.address_name}}</h2>
</ion-item>
var search = $scope.search;//接收到刚才传过来的通知
$scope.$on('getBookListFromServer:done', function () {
$scope.bookListData = BookListService.getBookList()
$scope.func = function () {
return $scope.bookListData.filter(function (bookList) {
if (search) {
if (bookList.mobile_number.indexOf(search) > -1) {
return true
} else {
return false
}
} else {
return true
}
})
}
});
万一不行,自己写个函数,做筛选
页:
[1]