title: Angular6-Angular Mat-pagintor is not working
body: <p>I am using Angular 6, My input for this file is cpDataSource it contains 1000 elements, can some one help me to understand why it is not working, Thanks in advance.</p>
  <p>HTML</p>
  <pre><code>&lt;div class=&quot; col-xs-12 col-sm-12 col-md-12&quot; *ngIf=&quot;cpDataSource&quot;&gt;
    &lt;table mat-table [dataSource]=&quot;cpDataSource&quot;  multiTemplateDataRows class=&quot;mat-elevation-z2&quot; cellspacing=&quot;40&quot;&gt;
    &lt;ng-container matColumnDef=&quot;Lastname&quot;&gt;
        &lt;th mat-header-cell *matHeaderCellDef&gt;
          &lt;b&gt;Last Name&lt;/b&gt;
        &lt;/th&gt;
        &lt;td mat-cell *matCellDef=&quot;let element&quot;&gt;
          &lt;tr&gt;{{element.lastName}} &lt;/tr&gt;
        &lt;/td&gt;
      &lt;/ng-container&gt;
    &lt;/table&gt;
    &lt;mat-paginator #MatPaginator [pageSizeOptions]=&quot;[10, 20]&quot; [pageSize]=&quot;10&quot; showFirstLastButtons&gt;&lt;/mat-paginator&gt;
  &lt;/div&gt;
  
  
  
  .TS
  export class TableSearchComponent implements OnInit, AfterViewInit {
  
    
    @Input()
    cpDataSource: ApplicationSearchResult[];
    @ViewChild(MatPaginator) paginator: MatPaginator;
     dataSource :MatTableDataSource&lt;any&gt;;
      ngOnInit() {
   }
    ngAfterViewInit(){
      this.dataSource = new MatTableDataSource(this.cpDataSource);
      this.dataSource.paginator = this.paginator;
    }
    }
  </code></pre>