Constructor fires as soon as your application runs, as we register all components under module. But ngOnInit fires only when application loads that particular component.If you have to do any API call, it’s advisable to define inside ngOnInit. We can do component property initialization inside constructor.