Angular Access inner component of ng-template
问题 Let's say we have a component called TopComponent with a template like this: <ng-template #top> <inner-selector #inner></inner-selector> </ng-template> It's code is simple: //... imports ... @Component({ // selector, styles etc }) export class TopComponent implements AfterViewInit { @ViewChild('top') topComp : NgbModal; // NgbModal is a type provided by some 3rd-party library // I can't modify it ngAfterViewInit() { // let's access the #inner component from here } } I can access the #top