I am retrieving a search query from php mysql into my angularjs app. The results are in the following format:
This object is then displayed in my angularjs app and displayed using ng-repeat. The thing is I would like to limit the results to 10 only. However for some reason it does not work. I did find a possible solution limiTo not working. Here it states LimitTo does not work if it is an object in an object. If this is the solution how would I convert srchResults to an object in an array in javascript?? If it is not what would be the 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>