1.

What are the differences between Constructors and OnInit?

Answer»
ConstructorsOnInit
It is the default METHOD USED for constructing components.It is an Angular 5 life cycle event method.
It is a TypeScript feature which is used for class instantiationsIt is used when there are any changes in the input or OUTPUT binding values.
It is CALLED before the ngOnInit()It is called after the constructors and the first ngOnChanges.


Discussion

No Comment Found