Angular2 -- ngAfterViewChecked is called many times..How to call a method just once after DOM is completely loaded?

Kcs picture Kcs · Dec 30, 2016 · Viewed 24.5k times · Source

I need to apply jquery plugin to radio buttons in Angular2 using Typescript.

If I assign in ngAfterViewChecked, it is called many times and the control is refreshed multiple times.

What is the alternate solution for calling the javascript method after DOM is ready?

Answer

SeleM picture SeleM · Dec 30, 2016

Try ngAfterViewInit and have a look here.