Closing actions must be defined on the controller.

Amber 1.13.10

I wanted to try closing actions, so I defined a route:

import Ember from 'ember';

export default Ember.Route.extend({
  actions: {
    doSave() { ... }
  }
});

and pattern:

{{my-component onSave=(action 'doSave')}}

But I get an error message: An action named 'doSave' was not found in (generated test.index controller).

However, it is determined on the route. Given the fact that Controllers are deprecated in Ember, I would expect the action to be defined on the route instead of the controller. Is there a specific reason why closing actions should be defined on the controller?

+4
source share
1 answer

Closing actions do not associate a route with the controller after the routed components of the earth replace the controllers.

, , .

+7

Source: https://habr.com/ru/post/1617023/


All Articles