I want to know if it is possible to access a template component within ng-template
using a template reference variable?
I have tried using @ViewChild and @ContentChild but none of them seems to work
Example: I want to have access to contents of app-common
<ng-template #first>
<app-common #second><app-common>
</ng-template>
@ViewChild('second') second1: ElementRef;
@ContentChild('second') second2: ElementRef;
ngAfterViewInit() {
console.log(this.second1);
}
ngAfterContentInit() {
console.log(this.second2);
}