Ember 1.13.10
I wanted to try out the closure actions, so I defined the a route:
import Ember from 'ember';
export default Ember.Route.extend({
actions: {
doSave() { ... }
}
});
and the template:
{{my-component onSave=(action 'doSave')}}
But I get the error message: An action named 'doSave' was not found in (generated test.index controller).
However it is defined on the route. Given the fact that Controllers are kind of deprecated in Ember I would expect that the action should be defined on the route instead of the controller. Is there a specific reason why the closure actions should be defined on the controller?
Closure actions communicate with the controller not the route, once routable components land they will replace controllers.
In your case if you wish to bubble the action you will have to send it from the controller.
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