Angular Lifecycle methods
Lifecycle hooks are methods called from the creation of a component or a directive to its destruction. For directives, the only lifecycle…