Answers for "how to bind two ng-content in a component angular"

0

how to bind two ng-content in a component angular

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>
Posted by: Guest on October-03-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language