Lifecycle Hooks

Download angular2 eBook

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

Related Examples

Stats

315 Contributors: 6
Thursday, June 29, 2017
Licensed under: CC-BY-SA

Not affiliated with Stack Overflow
Rip Tutorial: info@zzzprojects.com

Download eBook