Do you have any ideas how can I translate "Items per page" in Angular's mat-paginator
tag? The mat-paginator
is an element from Material Design.
相关问题
- Angular RxJS mergeMap types
- npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fs
- How to update placeholder text in ng2-smart-table?
- How to instantiate Http service in main.ts manuall
- Angular: ngc or tsc?
相关文章
- angular脚手架在ie9+下兼容问题
- angular 前端项目 build 报错 "Cannot find module 'le
- Angular Material Stepper causes mat-formfield to v
- After upgrade to Angular 9 cannot find variable in
- is there any difference between import { Observabl
- Suppress “Circular dependency detected” suppress w
- How can you get current positional information abo
- Angular material table not showing data
For a quick and dirty solution use this.paginator._intl property.
In my
...component.ts
I have:You can use the
MatPaginatorIntl
for this. Will Showell made an example that no longer works, so here is an updated version (with Dutch) and step-by-step guidance.MatPaginatorIntl
from@angular/material
into your application.import { getDutchPaginatorIntl } from './app/dutch-paginator-intl';
inmain.ts
fileprovider
for the Paginator inside of themain.ts
file, so it takes the translations of your local file (instead of English as default language):Example on StackBlitz with the paginator translations file as starting point.
Update to Angular 6.x
This updated Example on StackBlitz is upgraded to Angular 6.x to accommodate the latest version of the framework. Only packages have changed, nothing inside the paginator has changed.
Modified solution (with Angular 6) based on accepted answer with @ngx-translate:
And the
PaginatorI18n
:and
cz.json
Configure ngx-translate in
app.module.ts
: