NARESH VERMA
What are Angular lifecycle hooks available?

Angular application goes through an entire set of processes or has a lifecycle right from its initiation to the end of the application.
The description of each lifecycle method is as below,
i. ngOnChanges: When the value of a data bound property changes, then this method is called.
ii. ngOnInit: This is called whenever the initialization of the directive/component after Angular first displays the data-bound properties happens.
iii. ngDoCheck: This is for the detection and to act on changes that Angular can’t or won’t detect on its own.
iv. ngAfterContentInit: This is called in response after Angular projects external content into the component’s view.
v. ngAfterContentChecked: This is called in response after Angular checks the content projected into the component.
vi. ngAfterViewInit: This is called in response after Angular initializes the component’s views and child views.
vii. ngAfterViewChecked: This is called in response after Angular checks the component’s views and child views.
viii. ngOnDestroy: This is the cleanup phase just before Angular destroys the directive/component.

By NARESH VERMA in Angular on Jan 20 2021
  • Pranam Bhat
    May, 2021 21

    ngOnchanges() ngOnInit() ngDoCheck() ngAfterContentInit() ngAfterContentChecked() ngAfterViewInit() ngAfterViewChecked() ngOnDestroy()

    • 0
  • Kiran Mohanty
    Jan, 2021 22

    ngOnChanges ngOnInit ngDoCheck ngOnDestroyngAfterContentInit ngAfterContentChecked ngAfterViewInit ngAfterViewCheckedThese are the angular life cycle hook events.

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS