While each application runs, Angular automatically creates, modifies, and destroy components and their associated HTML. Since developer initialization and cleaning up the code must be synchronized with the preceding Angular processing stages, Angular exposes events all components and directives must use to run initialization, update, and cleanup at the right time.
There are lifetime events that are triggered just once in the life of each component/directive instance, and update events that are linked to the Angular change detection process (sketched in Chapter 10, Angular ASP.NET Core Project Template). Lifetime events are used by all developers the most, since they allow proper component/directive initialization and enable the developer to modify the HTML code generated by Angular, for instance, by adding non-Angular widgets. Update events are less...