通用组件-TemplateRef应用

This commit is contained in:
禾几海
2020-07-01 13:54:32 +08:00
parent 014a9eebe4
commit 8cc8f8e8d5
7 changed files with 80 additions and 12 deletions

View File

@@ -26,7 +26,14 @@
nzTooltipPlacement="top"
nz-tooltip>
<ng-template [ngIf]="!headData.isActionColumns">
{{ getValue(index, headData.fieldValue) }}
<ng-template [ngIf]="template[headData.fieldValue]">
<ng-container
*ngTemplateOutlet="template[headData.fieldValue].temp; context:getContext(headData.fieldValue,index) ">
</ng-container>
</ng-template>
<ng-template [ngIf]="!template[headData.fieldValue]">
{{ getValue(index, headData.fieldValue) }}
</ng-template>
</ng-template>
<ng-container *ngIf="headData.isActionColumns">
<a *ngFor="let action of headData.action; let i = index" (mouseenter)="action.hover(t)"