javascript - Angularjs limitTo not working in ng-repeat -
i retrieving search query php mysql angularjs app. results in following format:
this object displayed in angularjs app , displayed using ng-repeat. thing limit results 10 only. reason not work. did find possible solution limito not working. here states limitto not work if object in object. if solution how convert srchresults object in array in javascript?? if not issue?
i'm using angular 1.3.11.
my code:
<md-list-item class="md-3-line" ng-repeat="result in srchresults|limitto:10" > <div class="md-list-item-text" ng-click= "getemployee(result.employee_id)"> <h3>{{result.last_name}}, {{result.first_name}}</h3> <h4>{{result.name}}</h4> <p>{{result.fk_cs_type}}, {{result.is_active==1?"active":"in-active"}}</p> <md-divider ng-if="!$last"></md-divider> </div> </md-list-item>
to answer query about
how convert srchresults object in array in javascript
to convert "object of objects" "array of objects" can following:
var obj; //your parent object var res = [] //will stor result here for(var in obj) { res.push(obj[i]); }
after loop ends, have res
desired array
Comments
Post a Comment