I'm experimenting with using ng-template in a separate component and referencing it in other parts of the html. Is this possible? I've tried different approaches but seem to be missing something. Can you help me understand where I might be going wrong?
ng-template.html
<ng-template #sample1>
<p>ng template content</p>
</ng-template>
display-template.html
<div *ngIf="found;">
<ng-container *ngTemplateOutlet="sample1"></ng-container>
</div>
DisplayTemplateComponent.ts
export class DisplayTemplateComponent {
@ViewChild('sample1', {static: false}) sample1: ElementRef;
found = true;
}