How to show empty message in data table angular material, If no data found

前端 未结 18 967
别那么骄傲
别那么骄傲 2021-01-07 16:51

I am using this code

 
  
    

        
18条回答
  •  情深已故
    2021-01-07 17:27

    In newer Angular versions don't forget datasource.data if your datasource is of type MatTableDataSource.

    Example:

    In the TypeScript file:

    // ...
    datasource = new MatTableDataSource([]);
    // ...
    
    
    

    And in the HTML file:

    提交回复
    热议问题