title: MatSort is not working properly
body: <p>MatSort is not working properly. I have imported the MatSort module from @angular/material. MatSort is working only for first 2 rows.</p>
  
  <pre><code>&lt;mat-table [dataSource]="dataSource" matSort&gt;
      &lt;ng-container matColumnDef="slno"&gt;
        &lt;mat-header-cell *matHeaderCellDef mat-sort-header&gt; SL NO. &lt;/mat-header-cell&gt;
        &lt;mat-cell *matCellDef="let row; let i = index"&gt; {{i+1}} &lt;/mat-cell&gt;
      &lt;/ng-container&gt;
  
      &lt;ng-container matColumnDef="project"&gt;
         &lt;mat-header-cell *matHeaderCellDef mat-sort-header&gt; PROJECT&lt;/mat-header-cell&gt;
         &lt;mat-cell *matCellDef="let row"&gt; {{row.project_name}}&lt;/mat-cell&gt;
      &lt;/ng-container&gt;
  
      &lt;mat-header-row *matHeaderRowDef="displayedColumns"&gt;&lt;/mat-header-row&gt;
      &lt;mat-row *matRowDef="let row; columns: displayedColumns;"&gt;&lt;/mat-row&gt;
  &lt;/mat-table&gt;
  </code></pre>
  
  <p>TS:</p>
  
  <pre><code>@Component({
    selector: 'project',
    templateUrl: './project.component.html',
    styleUrls: ['./project.component.css']
  })
  export class ProjectComponent implements OnInit {
    displayedColumns = ['slno', 'project', 'startdate', 'enddate', 'action'];
    @ViewChild(MatSort) sort: MatSort;
  ngOnInit() {
    //get data
    this.dataSource = new MatTableDataSource(data);
    this.dataSource.paginator = this.paginator;
       this.dataSource.sort = this.sort;
  }
  </code></pre>