Reputation: 57
Question: I had array of objects for ex: listArray[].
var listArray =[];
in that array i have 1000 objects, i want show 10 objects in table. and below the table
"Load More Data" button. when I click on Load more data button i need show next 10 objects in that table, pervious 10 objects should be scroll up. using AngularJS.
any one please help me.
Upvotes: 0
Views: 1184
Reputation: 2585
hope it helps out
<table ng-init="start=10">
...
<tr ng-repeat="element in listArray.splice(0, start)" >
...
</tr>
...
</table>
....
<button ng-click="start=start + 10" ng-disabled="start > listArray.length">Load More Data</button>
Upvotes: 0
Reputation: 45295
You can use limitTo:
<li ng-repeat="element in listArray | limitTo:limit">
Upvotes: 1