What is the best choice to communicate with grandchildren?
For example.
I have a HomePage with footer buttons. Inside HomePage I have a component X. Inside the component X I have a component Y, which is a form product.
I wanna to action a footer button from HomePage to method of Component Y, but with that instance.
Injectable create a new component (dont works).
Would be awesome if could be:
(home.html)
<my-component-products #products>
button click=“products.product.add()”
(my-component-products.html)
– list of product –
<my-component-product-form #product>
(my-component-product-form.ts)
add() {
console.log(“I’m being fired from the homepage”);
}
Do you understand me ? I would like to speak with the instances of my grandchildren!
Why I cannot use products.product.add() ??