为什么分页不起作用
export class AppComponent implements OnInit {
title = 'app';
displayedColumns: string[] = ['position', 'name', 'weight', 'symbol'];
dataSource = new MatTableDataSource<PeriodicElement>(ELEMENT_DATA);
@ViewChild(MatPaginator) paginator: MatPaginator;
ngOnInit() {
this.dataSource.paginator = this.paginator;
}
这是我从https://material.angular.io/components/table/overview复制的同一个例子