I have some view components with are used in a heirarchy:
Application
Store
Department
Product
Each component only knows about itself, so the data passed to the
product view only contains product data, and does not contain the
department or store that the product is within.
When a product is clicked I dispatch a custom event
'productSelectedEvent' giving the id of the product selected.
What I also need is to have the department id and the store id, when
the event bubbles up to the application.
Is it appropriate to have an event listener on 'productSelectedEvent'
in the department view that adds the current department id to the
event, and then similarly in Store add the store id to
'productSelectedEvent'.
The event 'productSelectedEvent' has 3 custom properties:
productId
departmentId
storeId
Thanks Andrew