title: using @viewChild in angular 8
body: <p>I have an application that use @ViewChild and below is the code I have</p>
  
  <pre><code> @ViewChild('paginator', { read: MatPaginator, static: true}) public paginator: MatPaginator;
  </code></pre>
  
  <p>on the front I am using
  <code>&lt;mat-paginator [ngStyle]="{'display': orders.length &gt; 0 ? 'flex': 'none' }" #paginator&gt;</code> 
  and I have implemented AfterViewInit and this is the code I have just to check that the paginator has been initialised:</p>
  
  <pre><code>ngAfterViewInit(): void {
      console.log('tab group', this.paginator);
  }
  </code></pre>
  
  <p>but the this.tabGroup is undefined and hence I can't set it's property. What am I doing wrong.</p>
  
  <p>Thanks</p>