I am trying to keep pagination in my Angular application using uib-pagination
. I am unable to get proper way to do this.
HTML
<table id="mytable" class="table table-striped">
<thead>
<tr class="table-head">
<th>Name</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="person in aCandidates">
<th>
<div>{{person}}</div>
</th>
</tr>
</tbody>
</table>
Controller
$scope.totalItems = $scope.aCandidates.length;
$scope.currentPage = 1;
$scope.itemsPerPage = 10;
I am able to see the pagination bar but no action is performed with that and the entire table data is rendered even after giving total-items as 10.
How exactly uib-pagination works and how is the data (in this case aCandidates
) is linked to pagination.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…