@@ -565,7 +565,7 @@ class MatTableApp {
565
565
columnsToRender = [ 'column_a' , 'column_b' , 'column_c' ] ;
566
566
isFourthRow = ( i : number , _rowData : TestData ) => i == 3 ;
567
567
568
- @ViewChild ( MatTable ) table : MatTable < TestData > ;
568
+ @ViewChild ( MatTable , { static : true } ) table : MatTable < TestData > ;
569
569
}
570
570
571
571
@Component ( {
@@ -595,7 +595,7 @@ class NativeHtmlTableApp {
595
595
dataSource : FakeDataSource | null = new FakeDataSource ( ) ;
596
596
columnsToRender = [ 'column_a' , 'column_b' , 'column_c' ] ;
597
597
598
- @ViewChild ( MatTable ) table : MatTable < TestData > ;
598
+ @ViewChild ( MatTable , { static : true } ) table : MatTable < TestData > ;
599
599
}
600
600
601
601
@Component ( {
@@ -615,7 +615,7 @@ class StickyTableApp {
615
615
dataSource = new FakeDataSource ( ) ;
616
616
columnsToRender = [ 'column_a' ] ;
617
617
618
- @ViewChild ( MatTable ) table : MatTable < TestData > ;
618
+ @ViewChild ( MatTable , { static : true } ) table : MatTable < TestData > ;
619
619
}
620
620
621
621
@@ -682,9 +682,9 @@ class ArrayDataSourceMatTableApp implements AfterViewInit {
682
682
dataSource = new MatTableDataSource < TestData > ( ) ;
683
683
columnsToRender = [ 'column_a' , 'column_b' , 'column_c' ] ;
684
684
685
- @ViewChild ( MatTable ) table : MatTable < TestData > ;
686
- @ViewChild ( MatPaginator ) paginator : MatPaginator ;
687
- @ViewChild ( MatSort ) sort : MatSort ;
685
+ @ViewChild ( MatTable , { static : true } ) table : MatTable < TestData > ;
686
+ @ViewChild ( MatPaginator , { static : true } ) paginator : MatPaginator ;
687
+ @ViewChild ( MatSort , { static : true } ) sort : MatSort ;
688
688
@ViewChild ( MatSortHeader ) sortHeader : MatSortHeader ;
689
689
690
690
constructor ( ) {
@@ -735,8 +735,8 @@ class MatTableWithSortApp implements OnInit {
735
735
dataSource = new MatTableDataSource < TestData > ( ) ;
736
736
columnsToRender = [ 'column_a' , 'column_b' , 'column_c' ] ;
737
737
738
- @ViewChild ( MatTable ) table : MatTable < TestData > ;
739
- @ViewChild ( MatSort ) sort : MatSort ;
738
+ @ViewChild ( MatTable , { static : true } ) table : MatTable < TestData > ;
739
+ @ViewChild ( MatSort , { static : true } ) sort : MatSort ;
740
740
741
741
constructor ( ) {
742
742
this . underlyingDataSource . data = [ ] ;
@@ -786,8 +786,8 @@ class MatTableWithPaginatorApp implements OnInit {
786
786
dataSource = new MatTableDataSource < TestData > ( ) ;
787
787
columnsToRender = [ 'column_a' , 'column_b' , 'column_c' ] ;
788
788
789
- @ViewChild ( MatTable ) table : MatTable < TestData > ;
790
- @ViewChild ( MatPaginator ) paginator : MatPaginator ;
789
+ @ViewChild ( MatTable , { static : true } ) table : MatTable < TestData > ;
790
+ @ViewChild ( MatPaginator , { static : true } ) paginator : MatPaginator ;
791
791
792
792
constructor ( ) {
793
793
this . underlyingDataSource . data = [ ] ;
0 commit comments