import {MatPaginatorModule} from '@angular/material/paginator';
MatPaginatorIntl
To modify the labels and text displayed, create a new instance of MatPaginatorIntl and include it in a custom provider
Name | Description |
---|---|
|
Stream to emit from when labels are changed. Use this to notify components when the labels have changed after initialization. |
|
A label for the button that moves to the first page. |
|
A label for the range of items within the current page and the length of the whole list. |
|
A label for the page size selector. |
|
A label for the button that moves to the last page. |
|
A label for the button that increments the current page. |
|
A label for the button that decrements the current page. |
MatPaginator
Component to provide navigation between paged information. Displays the size of the current page, user-selectable options to change that size, what items are being shown, and navigational button to go to the previous or next page.
Selector: mat-paginator
Exported as: matPaginatorName | Description |
---|---|
@Input()
|
Theme color to be used for the underlying form controls. |
@Input()
|
Whether the component is disabled. |
@Input()
|
Whether to hide the page size selection UI from the user. |
@Input()
|
The length of the total number of items that are being paginated. Defaulted to 0. |
@Input()
|
The zero-based page index of the displayed list of items. Defaulted to 0. |
@Input()
|
Number of items to display on a page. By default set to 50. |
@Input()
|
The set of provided page size options to display to the user. |
@Input()
|
Whether to show the first/last buttons UI to the user. |
@Output()
|
Event emitted when the paginator changes the page size or page index. |
|
Stream that emits once during the directive/component's ngOnInit. |
firstPage | |
---|---|
Move to the first page if not already there. |
getNumberOfPages | |
---|---|
Calculate the number of pages |
|
Returns | |
number
|
|
hasNextPage | |
---|---|
Whether there is a next page. |
|
Returns | |
boolean
|
|
hasPreviousPage | |
---|---|
Whether there is a previous page. |
|
Returns | |
boolean
|
|
lastPage | |
---|---|
Move to the last page if not already there. |
nextPage | |
---|---|
Advances to the next page if it exists. |
previousPage | |
---|---|
Move back to the previous page if it exists. |
PageEvent
Change event object that is emitted when the user selects a different page size or navigates to another page.
Name | Description |
---|---|
|
The current total number of items being paged |
|
The current page index. |
|
The current page size |
|
Index of the page that was selected previously. |