Angular Mat Table Error: Missing definitions for header and row

前端 未结 1 1284
不知归路
不知归路 2020-12-11 14:31

I am using MatTable from Angular Material 5.2.5. I trying to populate the table with data which is got through a server request.

The UI

  

        
相关标签:
1条回答
  • 2020-12-11 15:16

    You must add mat-row and mat-header-row(optional) tags inside your table:

    <mat-table>
      .... columns definitions
    
      <mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
      <mat-row *matRowDef="let row; columns: displayedColumns;"></mat-row>
    </mat-table>
    

    See more examples here https://material.angular.io/components/table/overview

    0 讨论(0)
提交回复
热议问题