pagination-ng-lib
TypeScript icon, indicating that this package has built-in type declarations

1.1.3 • Public • Published

Pagination Library

Pagination for Angular 2+

Instalation

npm install pagination-ng-lib --save

Usage

Code for compontent.html

<pgl-pagination
  [currentPage]="currentPage"
  [totalPages]="totalPages"
  [maxPerPage]="maxPerPage"
  (pageSelected)="pageSelected($event)">
</pgl-pagination>

Code for component.ts

  currentPage = 1;
  totalPages = 10;
  maxPerPage = 5; // Best to use odd numbers

  // Use this function to call API and fetch resourses
  // passing the page number "currentPage"
  pageSelected(currentPage) {
    console.log(currentPage);
  }

Readme

Keywords

none

Package Sidebar

Install

npm i pagination-ng-lib

Weekly Downloads

2

Version

1.1.3

License

none

Unpacked Size

120 kB

Total Files

23

Last publish

Collaborators

  • cloud.build