How do i wrap the turbotable into my own component? I tried by passing the header and body template as ContentChildren and this works until i add pSortableColumn. Then i get the error:
Code: Select all
TableContainerPageComponent.html:55 ERROR Error: StaticInjectorError(AppModule)[TableBody -> Table]:
StaticInjectorError(Platform: core)[TableBody -> Table]:
NullInjectorError: No provider for Table!
Wrapper html:
Code: Select all
<p-table>
<ng-template let-item [pTemplate]="template.name" *ngFor="let template of templates">
<ng-template *ngTemplateOutlet="template.template; context: { $implicit: item }"></ng-template>
</ng-template>
</p-table>
Code: Select all
@ContentChildren(PrimeTemplate)
templates: QueryList<any>;
Code: Select all
<fw-table>
<ng-template pTemplate="header">
<tr>
<th [pSortableColumn]="'username'">Gebruikersnaam</th>
<th >Voornaam</th>
<th >Achternaam</th>
</tr>
</ng-template>
<ng-template pTemplate="body" let-user>
<tr [pSelectableRow]="user">
<td>{{user.username}}</td>
<td>{{user.voornaam}}</td>
<td>{{user.achternaam}}</td>
</tr>
</ng-template>
</fw-table>
Glenn