© Adam Freeman 2018Adam FreemanPro Vue.js 2https://doi.org/10.1007/978-1-4842-3805-9_18
18. Loosely Coupled Components
As a Vue.js application grows, the need to pass data and events between parent and child components becomes harder to arrange, especially when components in different parts of the application need to communicate. The result can be components whose own functionality is overtaken by the need to pass on props for their descendants and relay events to their antecedents. In this chapter, I describe an alternative approach, known as dependency injection, which allows components to communicate without being tightly coupled to one another. I show you the different ways in which dependency injection can be used ...