emptyMessage属性不显示

当lista数据值为空时,我需要显示一条消息:

 <p-table [value]="listElement" [paginator]="true" [rows]="10" [rowsPerPageOptions]="[5,10,20]" [showCurrentPageReport]="true" emptyMessage="No record found">
                    <ng-template pTemplate="header">
                        <tr>
                            <th>Code</th>

                        </tr>
                    </ng-template>

                    <ng-template pTemplate="body" let-elements>
                        <tr>
                            <td>{{elements.code}}</td>

                        </tr>
                    </ng-template>
                </p-table>

The problem that when the listElement is empty it doesn't show the message in emptyMessageproperty, but sho only the table empty. Anyone know how I can resolve this problem?

评论