Constructor: For injecting dependencies.
ngOnInit: Perfect for initialisation logic, it runs after component initialisation.


Related Question