In Order
- constructor()
- ngOnChanges(changes: SimpleChanges) - It is called every time the data changes.
- ngOnInit() - it is called only once when the component is loaded into the DOM
- ngDoCheck() - whenever theere is a change detection
- ngAfterContentInit() - is called once external content is projected into component’s view and right after the first ngDoCheck() and occurs only once.
- ngAfterContentChecked() - called once after ngAfterContentInit() and everytime after ngDoCheck()
- ngAfterViewInit() - is called once after the component’s view/ child views are loaded and right after ngAfterContentChecked() and occurs only once.
- ngAfterViewChecked() - called once after ngAfterViewInit() and everytime after ngDoCheck()