Paginator for Angular
ngpq-pagination
Installation
npm install ngpq-pagination
Example
Template
<ngpq-pagination
[pageSize]="8"
[maxSize]="6"
[(page)]="pageNumber"
[totalElements]="data.length"
[arrows]="arrows"
[directionLinks]="true"
(pageChange)="pageChange($event)">
</ngpq-pagination>
Component
export class AppComponent {
pageNumber = 1;
arrows = new PaginationArrow('prev', 'next', 'first', 'last');
}
Module
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component.ts';
import { NgPqPaginationModule } from 'ngpq-pagination';
export class AppModule {
declarations: [
AppComponent
],
imports: [
NgPqPaginationModule
]
}
Inputs
[(page)]: number;
[pageSize]: number;
[maxSize]: number;
[totalElements]: number;
[directionLinks]: boolen;
Ouputs
(pageChange): EventEmitter<number>;