x-table.component:
Code: Select all
<p-table>
<ng-container ></ng-container> -----> template for the header
<ng-container></ng-container> -----> template for the the body
</ptable>
Code: Select all
<x-table [headerTemplate]="headerTemplate " [bodyTemplate]="bodyTemplate">
<ng-template #headerTemplate let-columns="columns">
<tr>
<th *ngFor="let col of columns" [pSortableColumn]="col.field"> ---> how can I access pSortableColumn from x-table?
{{col.name}}
</th>
</tr>
</ng-template>
<ng-template #bodyTemplate let-columns="columns" let-rowData>
<tr>
<td>
{{rowData.name}}
</td>
</tr>
</ng-template>
</x-table>