Explain Lifecycle Hooks
Angular Creates the component, Renders it and then Creates and Renders its children Component, then it Processes the changes in component with its data-bound properties changes, and then destroys it before removing its template from the DOM.
There are three most important Component Lifecycle Hooks
OnInit: Perform Component initialization, Retrieve Data
OnChanges: Perform action after changes to input property
OnDestroy: Perform Cleanup
Implementing Lifecycle Hooks
Each lifecycle hook interface defines one method whose name is the interface name prefixed with ng for Angular. For example, the OnInit interface hook method is named ngOnInit.
Our first step here of implementing the interface is actually optional.