()
| 936 | @ViewChild(MatSort) sort!: MatSort; |
| 937 | |
| 938 | constructor() { |
| 939 | this.underlyingDataSource.data = []; |
| 940 | |
| 941 | // Add three rows of data |
| 942 | this.underlyingDataSource.addData(); |
| 943 | this.underlyingDataSource.addData(); |
| 944 | this.underlyingDataSource.addData(); |
| 945 | |
| 946 | this.underlyingDataSource.connect().subscribe(data => { |
| 947 | this.dataSource.data = data; |
| 948 | }); |
| 949 | } |
| 950 | |
| 951 | ngOnInit() { |
| 952 | this.dataSource!.sort = this.sort; |