mercredi 18 novembre 2015

How to get a component’s instance from within an eventManager object

When I have a component with an eventManager how can I get the instance of the component from within a handler?

The handler's second parameter contains only the component clicked on, which can be a nested component. When I define the handler directly on the component 'this' points to the component. In the eventManager it points to the eventManger.

I'd like to use the eventManager because it puts all handlers neatly in one place and passes the component from which the event originated. Is there a good solution to this problem?

Note: I have cross-posted this here. The original thread can be found on the ember forums. I hope to reach a broader audience here.

Aucun commentaire:

Enregistrer un commentaire