Angular 2 execute script after template render

The Solution to Angular 2 execute script after template render is


ngAfterViewInit() of AppComponent is a lifecycle callback Angular calls after the root component and it's children have been rendered and it should fit for your purpose.

See also https://angular.io/guide/lifecycle-hooks

~ Answered on 2016-03-23 17:07:58


Most Viewed Questions: