title: mat-filtering/mat-sort not work correctly when use ngif in mat-table parent
body: <p>Note that paging/sort not work correctly. Paging does not show the number of elements it is showing and sorting does not work, but if you delete the line in the html file <strong>*ngIf="dataSource?.filteredData.length > 0"</strong> the error is fixed.
  If you use filtering, it works, but it does not show the filter amount</p>
  
  <p>Check the example.</p>
  
  <p><a href="https://stackblitz.com/edit/angular-wqkekh-nm3pn2?file=app/table-pagination-example.html" rel="noreferrer">https://stackblitz.com/edit/angular-wqkekh-nm3pn2?file=app/table-pagination-example.html</a></p>