In the component you are using material paginator in, add this to.component.ts file
import { MatPaginatorIntl } from '@angular/material/paginator';
export class AppComponent {
constructor(private paginator: MatPaginatorIntl) {
paginator.itemsPerPageLabel = "My Items Per Page";
paginator.firstPageLabel = "First Page Label";
paginator.nextPageLabel = "My Next Page";
paginator.previousPageLabel = "My Previous Page";
paginator.getRangeLabel = (page: number, pageSize: number, length: number) => {
length = Math.max(length, 0);
const startIndex = page * pageSize;
const endIndex =
startIndex < length
? Math.min(startIndex + pageSize, length)
: startIndex + pageSize;
return `${startIndex + 1} of ${endIndex} / ${length}`;
}
}
// ...
}
See https://material.angular.io/components/paginator/api#material-paginator-services
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.