I am trying to use the component life cycle hooks that are exposed by Angular 4 to process certain information related to the component.
When I tried to search I was able to find the list of life cycle hooks that are exposed by angular 4 (https://angular.io/guide/lifecycle-hooks)
I am more interested in the code snippet that triggers few of these methods.
For example in Java following lines of code would trigger the constructor in 'String' class:
String hotelName = new String("Marriott");
What would be the HTML, JavaScript code that would trigger following life cycle methods:
- constructor
- ngOnInit
- ngAfterViewInit
- ngAfterViewChecked
- ngOnDestroy
Thanks in advance.