()
| 884 | @ViewChild(MatSortHeader) sortHeader!: MatSortHeader; |
| 885 | |
| 886 | constructor() { |
| 887 | this.underlyingDataSource.data = []; |
| 888 | |
| 889 | // Add three rows of data |
| 890 | this.underlyingDataSource.addData(); |
| 891 | this.underlyingDataSource.addData(); |
| 892 | this.underlyingDataSource.addData(); |
| 893 | |
| 894 | this.underlyingDataSource.connect().subscribe(data => { |
| 895 | this.dataSource.data = data; |
| 896 | }); |
| 897 | } |
| 898 | |
| 899 | ngAfterViewInit() { |
| 900 | this.dataSource.sort = this.sort; |