错误
Error: [filter:notarray] Expected array but received: 0
HTML
{p> 激活器({1}}功能的一个菜单项。getConcessionaireList
输入搜索以查看<ion-item ng-click="getConcessionaireList()" >
</ion-item>
$scope.concessionairesList
单击激活器时,将显示<input type="search" placeholder="Search" ng-model="searchQuery">
<ion-list>
中的值。
$scope.concessioniresList
JS
数据将使用<ion-item class="item item-icon-left" ng-repeat="x in concessionairesList track by $index | filter:searchQuery" href="#/app/encodereading/{{x.accountNumber}}">
{{x.accountNumber}} - {{x.meterNumber}} - {{x.lastName | capitalize}}, {{x.firstName | capitalize}} {{x.middleName | initial}}
</ion-item>
php
答案 0 :(得分:3)
您在应用过滤器之前使用 track by $index
。要解决此问题,请将表达式更改为:
<ion-item class="item item-icon-left" ng-repeat="x in concessionairesList | filter:searchQuery track by $index" href="#/app/encodereading/{{x.accountNumber}}">