I would like to create an app-my-component component, which can be used in the following way:
<app-my-component>
<div>Some element inside</div>
</app-my-component>
Then I would like to use that component/html element inside the app-my-component, like this:
<p>You provided this element as parameter:</p>
<ng-template [ngTemplateOutlet]="inputElement"></ng-template>
How is it possible? I was not able to find any documentation about this, but I once saw a code using this feature, so I hope it is still possible.
I added this to the MyComponent class:
@ContentChild(TemplateRef)
public inputElement: TemplateRef;
But the element does not appear.