error
Error: [filter:notarray] Expected array but received: 0
html
Activator (a menu item) of the getConcessionaireList function.
<ion-item ng-click="getConcessionaireList()" >
</ion-item>
Input search for the lists of displayed data from $scope.concessionairesList
<input type="search" placeholder="Search" ng-model="searchQuery">
<ion-list>
Values from $scope.concessioniresList is to be displayed here when Activator is clicked.
<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>
js
Data that will be fetched from database using php
$scope.getConcessionaireList = function(){
$http.get('http://localhost/test/php/getConcessionaires.php').then(function(res){
$scope.show($ionicLoading);
console.log(res.data);
$scope.concessionairesList = res.data;
}).finally(function(){
$timeout(function(){
$scope.hide($ionicLoading);
}, 1000)
})
}