Posted on 27th February 2024|70 views
By default, angular provides life cycle hook ngOnInit. Why should ngOnInit be used, if we already have a constructor?
Posted on 27th February 2024
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.
STILL GOT QUERIES?