Posted on 28th April 2025|80 views
By default, angular provides life cycle hook ngOnInit. Why should ngOnInit be used, if we already have a constructor?
Posted on 28th April 2025| views
A constructor is a method which is called whenever an object is created. It is generally used for initializing class members. In Angular, ngOnInit() is one of the component's life hooks called to indicate that component is initialized.