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

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

I am using this code

 
  
    

        
18条回答
  •  花落未央
    2021-01-07 17:27

    If anyone uses filter with dataSource, you should watch for dataSource.filteredData.length.

    i.e.

    if (this.dataSource.filteredData.length < 1) {
      this.presentDialog();
    }
    

    or

    // Your message here...

提交回复
热议问题