Consider the scenario with MyComponent:
<div [my-component]="'text'"></div>
Within the code, I have access to this.viewContainerRef
, which refers to the DOM node itself (<div>
).
However, for customization purposes, a user might want to include their own template within myComponent
. In such cases, they would do the following:
<div [my-component]="'text'">
<template>
...
</template>
</div>
The question at hand is how can I programmatically determine if there is a <template>
element within the <div>
and then manipulate its content?