HTML代码:
<input type="search" name="search" placeholder="Search for members in first name,last name and email" ng-model="query" class="form-control input-box"> <tr ng-repeat="item in filterData = (totalItems| filter : search) | limitTo:10:10*(page-1)" ng-cloak> </tr>
JS代码:
$scope.search = function (row) { return !!(( row.member_fname.indexOf($scope.query || '') !== - 1 || row.member_lname.indexOf($scope.query || '') !== - 1 || row.member_email.indexOf($scope.query || '') !== - 1)); };
答案 0 :(得分:0)
更新您的JS代码
$scope.search = function (row) { var query = $scope.query || ''; return !!(( row.member_fname.toLowerCase().indexOf(query.toLowerCase()) !== - 1 || row.member_lname.toLowerCase().indexOf(query.toLowerCase()) !== - 1 || row.member_email.toLowerCase().indexOf(query.toLowerCase()) !== - 1)); };