Today we are discussing class constructor and ngOnInit. This is very frequently asked question in the interview if you are going for an Angular Developer.

Angular developer sometimes writes some code in the constructor which are related to angular and sometimes they getting undefined because constructor calls before creating the component.