I have a nested chain of components that is at least 4 deep, parent -> child -> grand-child -> great-grand-child. I know how to pass a variable step by step through the chain but I would like to be able to pass it directly from parent to great-grand-child. Otherwise I have to write a fair bit of boilerplate code.
An easier way to circumvent having to pass the data down the components would be to share the data in a service, which can be injected into all relevant components. Just be sure to provide the service at the appropriate level to take advantage of hierarchical dependency injectors.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With