novo-elements
Version:
Bullhorn's NOVO Element Repository for Angular 2
38 lines (32 loc) • 1.16 kB
text/typescript
// NG2
import { Component, ElementRef, ViewContainerRef, ViewChild, Input, OnInit } from '@angular/core';
// APP
import { BaseRenderer } from './../base-renderer/BaseRenderer';
import { ComponentUtils } from './../../../../utils/component-utils/ComponentUtils';
export class RowDetails implements OnInit {
container: ViewContainerRef;
data: any;
renderer: any;
value: any = '';
constructor(private element: ElementRef, private componentUtils: ComponentUtils) {
}
ngOnInit() {
if (this.renderer) {
if (this.renderer.prototype instanceof BaseRenderer) {
let componentRef = this.componentUtils.appendNextToLocation(this.renderer, this.container);
componentRef.instance.data = this.data;
} else {
this.value = this.renderer(this.data);
}
} else {
// this.value = this.row[this.column.name];
}
}
}