Angular lifecycle hooks - Study24x7
Social learning Network

Warning: include(./views/auth.php): failed to open stream: Permission denied in /var/www/html/live/loginRightSlider.php on line 18

Warning: include(): Failed opening './views/auth.php' for inclusion (include_path='.:/usr/share/php') in /var/www/html/live/loginRightSlider.php on line 18

Angular lifecycle hooks

Updated on 08 July 2021
study24x7
virender kumar
3 min read 27 views
Updated on 08 July 2021

The description of each lifecycle method is as below,

  1. ngOnChanges: When the value of a data bound property changes, then this method is called.
  2. ngOnInit: This is called whenever the initialization of the directive/component after Angular first displays the data-bound properties happens.
  3. ngDoCheck: This is for the detection and to act on changes that Angular can't or won't detect on its own.
  4. ngAfterContentInit: This is called in response after Angular projects external content into the component's view.
  5. ngAfterContentChecked: This is called in response after Angular checks the content projected into the component.
  6. ngAfterViewInit: This is called in response after Angular initializes the component's views and child views.
  7. ngAfterViewChecked: This is called in response after Angular checks the component's views and child views.
  8. ngOnDestroy: This is the cleanup phase just before Angular destroys the directive/component.


study24x7
Write a comment...

Warning: count(): Parameter must be an array or an object that implements Countable in /var/www/html/live/article.php on line 1535

Warning: include(./views/article/relatedPost.php): failed to open stream: Permission denied in /var/www/html/live/article.php on line 1692

Warning: include(): Failed opening './views/article/relatedPost.php' for inclusion (include_path='.:/usr/share/php') in /var/www/html/live/article.php on line 1692