Search This Blog

Component lifecycle hooks in Angular

Component lifecycle hooks in Angular




Every component in Angular goes through different phases from the time of creation to the time it's destroyed. Angular provides hooks to tap into these phases and trigger changes at specific phases in a lifecycle.
  • Constructor
  • ngOnChanges
  • ngOnInit
  • ngDoCheck
    • ng AfterContentInit
    • ngAfterContentChecked
    • ngAfterViewInit
    • ngAfterViewChecked
  • ngOnDestroy