I need to show a message when the lista data value is empty:
<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 emptyMessage
property, but sho only the table empty. Anyone know how I can resolve this problem?