UNPKG

bixi

Version:

企业级中后台前端解决方案

20 lines (15 loc) 481 B
import { Injectable, TemplateRef } from '@angular/core'; import { NzSafeAny } from 'ng-zorro-antd/core/types/any'; interface IColTemplateRows { [key: string]: TemplateRef<NzSafeAny>; } @Injectable() export class EditableTemplateService { rows: Partial<IColTemplateRows> = {}; add(colName: string, ref: TemplateRef<NzSafeAny>) { this.rows[colName] = ref; } getTemplateRef(refName: string): TemplateRef<NzSafeAny> | undefined { return this.rows[refName]; } }