Each HTML element interacts with the remainder of the DOM by receiving input values in its properties and by providing output by issuing events that are intercepted by handlers added to other HTML elements. Thus, the DOM uses properties to provide inputs, and events to send outputs. The Modules, components, and data-binding section in Chapter 10, Angular ASP.NET Core Project Template, discusses how HTML element properties and events are handled by Angular, and how analogously to HTML elements, Angular components may receive input through input properties. Angular goes on with the analogy between HTML elements and components by also defining custom events for components.
The following are the general steps to enhance a component with an event type:
- Define a data type, say, T, that conveys the event information, and which information it must convey.
- Define...