@@ -538,7 +538,7 @@ class MatTableApp {
538
538
columnsToRender = [ 'column_a' , 'column_b' , 'column_c' ] ;
539
539
isFourthRow = ( i : number , _rowData : TestData ) => i == 3 ;
540
540
541
- @ViewChild ( MatTable ) table : MatTable < TestData > ;
541
+ @ViewChild ( MatTable , { static : true } ) table : MatTable < TestData > ;
542
542
}
543
543
544
544
@Component ( {
@@ -568,7 +568,7 @@ class NativeHtmlTableApp {
568
568
dataSource : FakeDataSource | null = new FakeDataSource ( ) ;
569
569
columnsToRender = [ 'column_a' , 'column_b' , 'column_c' ] ;
570
570
571
- @ViewChild ( MatTable ) table : MatTable < TestData > ;
571
+ @ViewChild ( MatTable , { static : true } ) table : MatTable < TestData > ;
572
572
}
573
573
574
574
@Component ( {
@@ -588,7 +588,7 @@ class StickyTableApp {
588
588
dataSource = new FakeDataSource ( ) ;
589
589
columnsToRender = [ 'column_a' ] ;
590
590
591
- @ViewChild ( MatTable ) table : MatTable < TestData > ;
591
+ @ViewChild ( MatTable , { static : true } ) table : MatTable < TestData > ;
592
592
}
593
593
594
594
@@ -655,9 +655,9 @@ class ArrayDataSourceMatTableApp implements OnInit {
655
655
dataSource = new MatTableDataSource < TestData > ( ) ;
656
656
columnsToRender = [ 'column_a' , 'column_b' , 'column_c' ] ;
657
657
658
- @ViewChild ( MatTable ) table : MatTable < TestData > ;
659
- @ViewChild ( MatPaginator ) paginator : MatPaginator ;
660
- @ViewChild ( MatSort ) sort : MatSort ;
658
+ @ViewChild ( MatTable , { static : true } ) table : MatTable < TestData > ;
659
+ @ViewChild ( MatPaginator , { static : true } ) paginator : MatPaginator ;
660
+ @ViewChild ( MatSort , { static : true } ) sort : MatSort ;
661
661
@ViewChild ( MatSortHeader ) sortHeader : MatSortHeader ;
662
662
663
663
constructor ( ) {
@@ -708,8 +708,8 @@ class MatTableWithSortApp implements OnInit {
708
708
dataSource = new MatTableDataSource < TestData > ( ) ;
709
709
columnsToRender = [ 'column_a' , 'column_b' , 'column_c' ] ;
710
710
711
- @ViewChild ( MatTable ) table : MatTable < TestData > ;
712
- @ViewChild ( MatSort ) sort : MatSort ;
711
+ @ViewChild ( MatTable , { static : true } ) table : MatTable < TestData > ;
712
+ @ViewChild ( MatSort , { static : true } ) sort : MatSort ;
713
713
714
714
constructor ( ) {
715
715
this . underlyingDataSource . data = [ ] ;
@@ -759,8 +759,8 @@ class MatTableWithPaginatorApp implements OnInit {
759
759
dataSource = new MatTableDataSource < TestData > ( ) ;
760
760
columnsToRender = [ 'column_a' , 'column_b' , 'column_c' ] ;
761
761
762
- @ViewChild ( MatTable ) table : MatTable < TestData > ;
763
- @ViewChild ( MatPaginator ) paginator : MatPaginator ;
762
+ @ViewChild ( MatTable , { static : true } ) table : MatTable < TestData > ;
763
+ @ViewChild ( MatPaginator , { static : true } ) paginator : MatPaginator ;
764
764
765
765
constructor ( ) {
766
766
this . underlyingDataSource . data = [ ] ;
0 commit comments