Angular 2 Component Constructor Vs OnInit

Viewed 101573

If I want function x to happen every time a component loads, whether its the first time, I navigate to a different site and navigate back or it's the fifth time the component has loaded.

What should I put function x in? The component constructor or OnInit?

3 Answers
Related