Is is possible to transclude custom column definitions via ng-content or TemplateRef or similar? I've been testing via Kendo UI Grid plunker available at site (http://www.telerik.com/kendo-angular-ui/components/grid/) as well as Angular2 child component as data but to no avail. I've also tried it ng-content select but also nothing. Any help is greatly appreciated, thanks!
@Component({
selector: 'test-component',
template:
`
<kendo-grid [data]="Data">
<kendo-grid-column></kendo-grid-column>
// ??? // <ng-content kendo-grid-column></ng-content> // [object Object]
// ??? // <kendo-grid-column ng-content></kendo-grid-column> // [object Object]
</kendo-grid>
`
})
export class TestComponent {
@Input() Data: any;
}
@Component({
selector: 'my-app',
template: `
<test-component [Data]="gridData">
<kendo-grid-column field="ProductID" title="Product ID" width="120"></kendo-grid-column>
<kendo-grid-column field="ProductName" title="Product Name"></kendo-grid-column>
<kendo-grid-column field="UnitPrice" title="Unit Price" width="230"></kendo-grid-column>
<kendo-grid-column field="Discontinued" width="120">
<template kendoCellTemplate let-dataItem>
<input type="checkbox" [checked]="dataItem.Discontinued" disabled/>
</template>
</kendo-grid-column>
</test-component>
`
})
export class AppComponent { ... }
As answered by @rusev in a comment prior ... this will work for me, thanks !
This is the answer as can be seen in the plunkr