- You could add dummy attributes
header
andbody
as opposed to template references(#header, #body)
. - And transclude using
ng-content
withselect
attribute likeselect="[header]"
.
app.comp.html
<app-child>
<div header >This should be rendered in header selection of ng-content</div>
<div body >This should be rendered in body selection of ng-content</div>
</app-child>
child.comp.html
<div class="header-css-class">
<ng-content select="[header]"></ng-content>
</div>
<div class="body-css-class">
<ng-content select="[body]"></ng-content>
</div>