We already used the simplest way to communicate and share data between components: the Input and Output decorators. Properties decorated with the Input decorator initialize a component by passing through data, and the Output decorator can be used to assign event listeners that will receive data out of the component. This approach can be observed with the components found in the Example2 folder from the source code for this chapter.
Communicating and sharing data between components
Referencing child components from a parent component
We can bypass the declarative binding to component properties and events using a template reference variable or by injecting the target component into the parent component via the ViewChild and...