pagination
This commit is contained in:
parent
7f4cf41c2e
commit
222d60c88f
|
@ -26,12 +26,12 @@ export class PaginationService {
|
||||||
let startIndex = (currentPage - 1) * pageSize;
|
let startIndex = (currentPage - 1) * pageSize;
|
||||||
let endIndex = Math.min(startIndex + pageSize - 1, totalGroups - 1);
|
let endIndex = Math.min(startIndex + pageSize - 1, totalGroups - 1);
|
||||||
|
|
||||||
// create an array of pages to ng-repeat in the pager control
|
// create an array of pages to ng-repeat in the pagination control
|
||||||
let pages = [];
|
let pages = [];
|
||||||
for (var i = 1; i <endPage + 1; i++)
|
for (var i = 1; i <endPage + 1; i++)
|
||||||
pages.push(i);
|
pages.push(i);
|
||||||
|
|
||||||
// return object with all pager properties required by the view
|
// return object with all pagination properties required by the view
|
||||||
return {
|
return {
|
||||||
totalGroups: totalGroups,
|
totalGroups: totalGroups,
|
||||||
currentPage: currentPage,
|
currentPage: currentPage,
|
||||||
|
|
Loading…
Reference in New Issue