Looking for angular2 Answers? Try Ask4KnowledgeBase
Looking for angular2 Keywords? Try Ask4Keywords

Angular 2Lifecycle Hooks


Remarks

Events availability

AfterViewInit and AfterViewChecked are only available in Components, and not in Directives.

Events order

  • OnChanges (multiple times)
  • OnInit (once)
  • DoCheck (multiple times)
  • AfterContentInit (once)
  • AfterContentChecked (multiple times)
  • AfterViewInit (once) (Component only)
  • AfterViewChecked (multiple times) (Component only)
  • OnDestroy (once)

Further Reading