In Angular 2 components life-cycle, there are several
events occur to complete this life-cycle.
Components Life-cycle events
Events
|
Description
|
ngOnChanges
|
Before Ng on init event, the data-bound input property value
changes.
|
ngOnInit
|
After the first ngOnChanges event, the ngOnInit event fire.
|
ngDoCheck
|
During every Angular change detection cycle ngDoCheck event fire.
|
ngAfterContentInit
|
After projecting content into the component ngAfterContentInit event
fire.
|
ngAfterContentChecked
|
After every check of projected component content the ngAfterContentChecked
event fire.
|
ngAfterViewInit
|
After initializing the component's views and child views the ngAfterViewInit
event fire.
|
ngAfterViewChecked
|
After every check of the component's views and child views the ngAfterViewChecked
event fire.
|
ngOnDestroy
|
Just before Angular destroys the directive or component the ngOnDestroy
event fire.
|
For more detail, you can go below links