Lifecycle Hooks
- Allow us to perform custom logic at various stages of a component's life span
- The most common use case is when data isn't immediately available in the constructor
- Implemented as class methods on the component class
- Should not be called directly except when writing unit tests
- The lifecycle interfaces are optional. We recommend adding them to benefit from TypeScript's strong typing and editor tooling
ngOnChangescalled when an input or output binding value changesngOnInitcalled after the first ngOnChangesngDoCheckhandles developer's custom change detectionngAfterContentInitcalled after component content initializedngAfterContentCheckedcalled after every check of component contentngAfterViewInitcalled after component's view(s) are initializedngAfterViewCheckedcalled after every check of a component's view(s)ngOnDestroycalled just before the directive is destroyed.

These lifecycle hooks are implicitly called. They should simply exist to delegate to some other functionality.