Call a method when ng-template is visible
问题 Does ng-template have any events when it is visible or active in the scope or is it possible to execute any method in such way to call it from the container? <ng-template (active/vissible)="callMethod()"> ... </ng-template> (Or) <ng-container *ngTemplateOutlet="mytemplate" ></ng-container> 回答1: One option could be (valid for any DOM object) is via ViewChildren's QueryList's changes. You mark any DOM element (or use it's type) - <div #myEl></div> Assign it: @ViewChildren('myEl') myEl: