So I have these two routes defined /Build /Build/education
Inside of the education route I have a component, and I'm trying to pass an action to it.
Education.hbs
{{#each model as |school|}}
{{common-education-institution model=school onAddSubject=(action 'addSubject')}}
{{/each}}
And I have an action defined in education.js
import Ember from 'ember';
export default Ember.Route.extend({
model() {
return this.modelFor('build').get('education');
},
actions: {
addSubject() {
}
}
});
When I start the app I get this error:
Uncaught Error: An action named 'addSubject' was not found in (generated build.education controller).
Education is a route not a controller, why is this error coming up??
Also I would like to define the action in build.js rather than education.js but the above is a greater problem. Any ideas on how to fix this?
Aucun commentaire:
Enregistrer un commentaire