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

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

I am using this code

 
  
    

        
18条回答
  •  無奈伤痛
    2021-01-07 17:11

    In .ts file

    if (this.dataSource.length == 0) {
        this.noDataMessage = true;
    } else {
        this.noDataMessage = false;
    }
    

    In .html file

    {{ 'label.DataNotAvailable' | translate }}

提交回复
热议问题