Ember Wishlist!

Change Actions to Events so .on() Works

This was one thing that threw me while learning Ember. Coming from jQuery, I (and most other developers) are familiar with jQuery’s .on/off() style of handling. I feel like Actions are the same thing. However, this is one thing I feel like I’m missing the concept. I understand that it’s not DOM specific, but why not? It provides natural bubbling as DOM events, up the route tree. Perhaps they could be namespaced to separate from typical DOM events.

Basically what I’m thinking is that actions: { actionName: function(){} } would become foobar: function(){}.on(‘actionName’). This could be combined with matchy’s RFC about better actions by function(){}.on(‘actionName.stateName’)

In this case, should .send() and .sendAction() become .trigger() and .triggerAction()?

2 Likes