PhoneGap中文网
标题:
轻轻问 ng-repeat filter的问题
[打印本页]
作者:
香草zzz
时间:
2016-11-25 16:48
标题:
轻轻问 ng-repeat filter的问题
小弟 刚学 请问 我这个自己写的filter为什么不起作用
<
ion-item
class=
"item-remove-animate item-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
}
})
}
});
作者:
ionicwang
时间:
2016-11-27 13:14
万一不行,自己写个函数,做筛选
欢迎光临 PhoneGap中文网 (http://bbs.phonegap100.com/)
Powered by Discuz! X3.2