I don't think there is an official solution for that at the moment and you have to synchronize the both paginators yourself.
Configure the first paginator as you like and add all the input params to the second one:
<mat-paginator #paginator [pageSizeOptions]="[5, 10, 20]" showFirstLastButtons></mat-paginator>
<table mat-table [dataSource]="dataSource"> <!-- ... --> </table>
<mat-paginator (page)="syncPrimaryPaginator($event)"
[pageSize]="paginator.pageSize" [pageIndex]="paginator.pageIndex"
[length]="paginator.length" [pageSizeOptions]="paginator.pageSizeOptions"></mat-paginator>
In your component add a method to sync the first paginator, if the second is used:
dataSource = new MatTableDataSource<PeriodicElement>(ELEMENT_DATA);
@ViewChild(MatPaginator) paginator: MatPaginator;
ngOnInit() {
this.dataSource.paginator = this.paginator;
}
syncPrimaryPaginator(event: PageEvent) {
this.paginator.pageIndex = event.pageIndex;
this.paginator.pageSize = event.pageSize;
this.paginator.page.emit(event);
}
I forked this official example and updated it to reproduce your problem. Here is my solution.