@@ -538,7 +538,7 @@ class MatTableApp {
538538 columnsToRender = [ 'column_a' , 'column_b' , 'column_c' ] ;
539539 isFourthRow = ( i : number , _rowData : TestData ) => i == 3 ;
540540
541- @ViewChild ( MatTable ) table : MatTable < TestData > ;
541+ @ViewChild ( MatTable , { static : true } ) table : MatTable < TestData > ;
542542}
543543
544544@Component ( {
@@ -568,7 +568,7 @@ class NativeHtmlTableApp {
568568 dataSource : FakeDataSource | null = new FakeDataSource ( ) ;
569569 columnsToRender = [ 'column_a' , 'column_b' , 'column_c' ] ;
570570
571- @ViewChild ( MatTable ) table : MatTable < TestData > ;
571+ @ViewChild ( MatTable , { static : true } ) table : MatTable < TestData > ;
572572}
573573
574574@Component ( {
@@ -588,7 +588,7 @@ class StickyTableApp {
588588 dataSource = new FakeDataSource ( ) ;
589589 columnsToRender = [ 'column_a' ] ;
590590
591- @ViewChild ( MatTable ) table : MatTable < TestData > ;
591+ @ViewChild ( MatTable , { static : true } ) table : MatTable < TestData > ;
592592}
593593
594594
@@ -655,9 +655,9 @@ class ArrayDataSourceMatTableApp implements OnInit {
655655 dataSource = new MatTableDataSource < TestData > ( ) ;
656656 columnsToRender = [ 'column_a' , 'column_b' , 'column_c' ] ;
657657
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 ;
661661 @ViewChild ( MatSortHeader ) sortHeader : MatSortHeader ;
662662
663663 constructor ( ) {
@@ -708,8 +708,8 @@ class MatTableWithSortApp implements OnInit {
708708 dataSource = new MatTableDataSource < TestData > ( ) ;
709709 columnsToRender = [ 'column_a' , 'column_b' , 'column_c' ] ;
710710
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 ;
713713
714714 constructor ( ) {
715715 this . underlyingDataSource . data = [ ] ;
@@ -759,8 +759,8 @@ class MatTableWithPaginatorApp implements OnInit {
759759 dataSource = new MatTableDataSource < TestData > ( ) ;
760760 columnsToRender = [ 'column_a' , 'column_b' , 'column_c' ] ;
761761
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 ;
764764
765765 constructor ( ) {
766766 this . underlyingDataSource . data = [ ] ;
0 commit comments