How can i project certain child elements of an injected content

64 Views Asked by At

i want to understand if i can selectively project certain children of an injected html block. lets assume i have a code block

<layout>
   <div>
      <h1>This is header 1</h1>
      <h2 class="projectThis">This is header 2</h2>
   </div>
</layout>

the layout component is an angular component with ng-content

<layout>
<ng-content select=".projectThis"></ng-content>
</layout>

but this does not work. angular does not see deep inside the projected contents. is there a way to do this. Any help is appreciated

0

There are 0 best solutions below