In my datatable project, developers can declare templates in the table declaration that will be used for the header cell and body cell.
<datatable>
<datatable-column name="Name">
<template let-column="column">
Header: {{column.name}}
</template>
<template let-value="value">
Hi: <strong>{{value}}</strong>
</template>
</datatable-column>
<datatable-column name="Age">
<datatable-body-template let-value="value">
I'm: <strong>{{value}}</strong> old
</datatable-body-template>
</datatable-column>
</datatable>
in the above example, the first template is the header cell template, and the second is the body cell template and order. If you only declare a single template, it will only make a body cell template. You can see how this is currently being done here .
Currently, I allow you to pass TemplateRefusing Inputa column directive, but this approach is approved, but as a consumer of the API, declarative templates inside the component definition are a cleaner approach.
, - #body #header, , .
DSL , , . ng-content selector, , - ? - :
<datatable>
<datatable-column name="Name">
<datatable-header-template let-column="column">
Header: {{column.name}}
</datatable-header-template>
<datatable-body-template let-value="value">
Hi: <strong>{{value}}</strong>
</datatable-body-template>
</datatable-column>
</datatable>
, , TemplateRef, , .
, , ... , ?