lundi 23 novembre 2015

Closure actions should be defined on controller

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?




Aucun commentaire:

Enregistrer un commentaire