ngx-pagination
- Version 6.0.3
- Published
- 248 kB
- 1 dependency
- MIT license
Install
npm i ngx-pagination
yarn add ngx-pagination
pnpm add ngx-pagination
Overview
The simplest solution for pagination in Angular.
Index
Classes
Interfaces
Type Aliases
Classes
class NgxPaginationModule
class NgxPaginationModule {}
property ɵfac
static ɵfac: i0.ɵɵFactoryDeclaration<NgxPaginationModule, never>;
property ɵinj
static ɵinj: i0.ɵɵInjectorDeclaration<NgxPaginationModule>;
property ɵmod
static ɵmod: i0.ɵɵNgModuleDeclaration< NgxPaginationModule, [ typeof i1.PaginatePipe, typeof i2.PaginationControlsComponent, typeof i3.PaginationControlsDirective ], [any], [ typeof i1.PaginatePipe, typeof i2.PaginationControlsComponent, typeof i3.PaginationControlsDirective ]>;
class PaginatePipe
class PaginatePipe {}
constructor
constructor(service: PaginationService);
property ɵfac
static ɵfac: i0.ɵɵFactoryDeclaration<PaginatePipe, never>;
property ɵpipe
static ɵpipe: i0.ɵɵPipeDeclaration<PaginatePipe, 'paginate'>;
method transform
transform: <T, U extends Collection<T>>( collection: U, args: PaginatePipeArgs) => U;
class PaginationControlsComponent
class PaginationControlsComponent {}
The default pagination controls component. Actually just a default implementation of a custom template.
property autoHide
autoHide: boolean;
property directionLinks
directionLinks: boolean;
property id
id: string;
property maxSize
maxSize: number;
property nextLabel
nextLabel: string;
property ɵcmp
static ɵcmp: i0.ɵɵComponentDeclaration< PaginationControlsComponent, 'pagination-controls', never, { id: 'id'; maxSize: 'maxSize'; directionLinks: 'directionLinks'; autoHide: 'autoHide'; responsive: 'responsive'; previousLabel: 'previousLabel'; nextLabel: 'nextLabel'; screenReaderPaginationLabel: 'screenReaderPaginationLabel'; screenReaderPageLabel: 'screenReaderPageLabel'; screenReaderCurrentLabel: 'screenReaderCurrentLabel'; }, { pageChange: 'pageChange'; pageBoundsCorrection: 'pageBoundsCorrection' }, never, never>;
property ɵfac
static ɵfac: i0.ɵɵFactoryDeclaration<PaginationControlsComponent, never>;
property pageBoundsCorrection
pageBoundsCorrection: EventEmitter<number>;
property pageChange
pageChange: EventEmitter<number>;
property previousLabel
previousLabel: string;
property responsive
responsive: boolean;
property screenReaderCurrentLabel
screenReaderCurrentLabel: string;
property screenReaderPageLabel
screenReaderPageLabel: string;
property screenReaderPaginationLabel
screenReaderPaginationLabel: string;
method trackByIndex
trackByIndex: (index: number) => number;
class PaginationControlsDirective
class PaginationControlsDirective {}
This directive is what powers all pagination controls components, including the default one. It exposes an API which is hooked up to the PaginationService to keep the PaginatePipe in sync with the pagination controls.
constructor
constructor(service: PaginationService, changeDetectorRef: ChangeDetectorRef);
property id
id: string;
property maxSize
maxSize: number;
property ɵdir
static ɵdir: i0.ɵɵDirectiveDeclaration< PaginationControlsDirective, 'pagination-template,[pagination-template]', ['paginationApi'], { id: 'id'; maxSize: 'maxSize' }, { pageChange: 'pageChange'; pageBoundsCorrection: 'pageBoundsCorrection' }, never>;
property ɵfac
static ɵfac: i0.ɵɵFactoryDeclaration<PaginationControlsDirective, never>;
property pageBoundsCorrection
pageBoundsCorrection: EventEmitter<number>;
property pageChange
pageChange: EventEmitter<number>;
property pages
pages: Page[];
method getCurrent
getCurrent: () => number;
Get the current page number.
method getLastPage
getLastPage: () => number;
Returns the last page number
method getTotalItems
getTotalItems: () => number;
method isFirstPage
isFirstPage: () => boolean;
Returns true if current page is first page
method isLastPage
isLastPage: () => boolean;
Returns true if current page is last page
method next
next: () => void;
Go to the next page
method ngOnChanges
ngOnChanges: (changes: any) => void;
method ngOnDestroy
ngOnDestroy: () => void;
method ngOnInit
ngOnInit: () => void;
method previous
previous: () => void;
Go to the previous page
method setCurrent
setCurrent: (page: number) => void;
Set the current page number.
class PaginationService
class PaginationService {}
property change
change: EventEmitter<string>;
method defaultId
defaultId: () => string;
method getCurrentPage
getCurrentPage: (id: string) => number;
Returns the current page number.
method getInstance
getInstance: (id?: string) => PaginationInstance;
Returns a clone of the pagination instance object matching the id. If no id specified, returns the instance corresponding to the default id.
method register
register: (instance: PaginationInstance) => boolean;
Register a PaginationInstance with this service. Returns a boolean value signifying whether the instance is new or updated (true = new or updated, false = unchanged).
method setCurrentPage
setCurrentPage: (id: string, page: number) => void;
Sets the current page number.
method setItemsPerPage
setItemsPerPage: (id: string, itemsPerPage: number) => void;
Sets the value of instance.itemsPerPage.
method setTotalItems
setTotalItems: (id: string, totalItems: number) => void;
Sets the value of instance.totalItems
Interfaces
interface PaginatePipeArgs
interface PaginatePipeArgs {}
property currentPage
currentPage?: string | number;
property id
id?: string;
property itemsPerPage
itemsPerPage?: string | number;
property totalItems
totalItems?: string | number;
interface PaginationInstance
interface PaginationInstance {}
property currentPage
currentPage: number;
The current (active) page.
property id
id?: string;
An optional ID for the pagination instance. Only useful if you wish to have more than once instance at a time in a given component.
property itemsPerPage
itemsPerPage: number;
The number of items per paginated page.
property totalItems
totalItems?: number;
The total number of items in the collection. Only useful when doing server-side paging, where the collection size is limited to a single page returned by the server API.
For in-memory paging, this property should not be set, as it will be automatically set to the value of collection.length.
Type Aliases
type Collection
type Collection<T> = T[] | ReadonlyArray<T>;
Package Files (7)
Dependencies (1)
Dev Dependencies (0)
No dev dependencies.
Peer Dependencies (2)
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/ngx-pagination
.
- Markdown[![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/ngx-pagination)
- HTML<a href="https://www.jsdocs.io/package/ngx-pagination"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 4372 ms. - Missing or incorrect documentation? Open an issue for this package.