UNPKG

bixi

Version:

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

19 lines (15 loc) 674 B
import { Directive, Host, Input, OnInit, TemplateRef } from '@angular/core'; import { NzSafeAny } from 'ng-zorro-antd/core/types'; import { EBixiCustomTplType } from '../table.type'; import { ColTemplateService } from './col-template.service'; @Directive({ selector: '[bixi-row]' }) export class BixiRowDirective implements OnInit { @Input('bixi-row') tplName: string; // 获取定义的列名 @Input() type: string = EBixiCustomTplType.body; constructor(private ref: TemplateRef<NzSafeAny>, @Host() private colTemplateService: ColTemplateService) { } ngOnInit() { this.colTemplateService.add(this.tplName, this.ref, this.type as EBixiCustomTplType); } }