我在 Angular 6 中使用 PrimeNG TurboTable。
这是html
<p-table #dataTable
[value]="primengTableHelper.records"
[rows]="primengTableHelper.defaultRecordsCountPerPage"
[paginator]="true"
[totalRecords]="primengTableHelper.totalRecordsCount">
<ng-template pTemplate="header">
<tr>
<th>{{l('Name')}}</th>
</tr>
</ng-template>
<ng-template pTemplate="body" let-record="$implicit">
<tr [pSelectableRow]="record">
<td>
<span>
{{record.displayName}}
</span>
</td>
</tr>
</ng-template>
</p-table>
这是component.ts
ngOnInit() {
this.getRoles();
}
getRoles(): void {
this.primengTableHelper.showLoadingIndicator();
let permission = this.permission ? this.selectedPermission : undefined;
this._roleService.getRoles(permission).subscribe(result => {
console.log(result);
this.primengTableHelper.records = result.items;
this.primengTableHelper.totalRecordsCount = result.items.length;
this.primengTableHelper.hideLoadingIndicator();
});
}
PrimeNG 表显示它的默认分页器。但我想让它漂亮。
我怎样才能做到这一点?请帮我。