import { Component, OnInit, ViewChild, Inject, ViewContainerRef, ViewEncapsulation } from '@angular/core';
. . . . .
export class AppComponent implements OnInit {
constructor(@Inject(ViewContainerRef) private viewContainerRef?: ViewContainerRef) {
}
ngAfterViewInit(): void {
for (let i = 0; i < this.gridColumns.length; i++) {
if (this.gridColumns[i]["field"] == "XML") {
this.gridColumns[i]["template"] = this.template;
this.gridColumns[i]['templateFn'] = templateCompiler(this.gridColumns[i]["template"]);
this.template.elementRef.nativeElement._viewContainerRef = this.viewContainerRef;
this.template.elementRef.nativeElement.propName = 'template';
}
}
this.grid.refreshColumns();
}
|