Explain the available lifecycle hooks?
The available lifecycle hooks are-
Below is the description of these lifecycle method-
ngOnChange- this method gets called whenever the values of data-bound property get changed.
ngOnInit-this method gets called when the initialization of directive/component after the Angular displays the data bound property happens.
ngDoCheck- it is used to detect or to act on the changes which Angular would not detect its own.
ngAfterContentInit- this method gets called, in response after the Angular projects the external content in the component’s view.
ngAfterContentChecked- this method gets called, in response after the Angular checks the projected content into components.
ngAfterViewInit- whenever The Angular initializes the component and the child views, this method gets called.
ngAfterViewChecked- whenever The Angular checks the component and the child views, this method gets called.
ngOnDestroy- is a clean-up phase which gets called before the Angular destroys the component or directive.