jeudi 7 avril 2016

Ember component action not bubbling up to template router

I have a component that should bubble an action up to its template router.

I pass the name of the action to the component:

{{project-table projects=model viewProject="viewProject"}}

Inside my component (project-table) controller, I have:

import Ember from 'ember';

export default Ember.Component.extend({
    actions: {
        viewProject: function (project) {
            this.sendAction('viewProject', project);
        }
    }
});

Inside the component template, I have:

<button type="button" {{action "viewProject" project}}>
    My Button
</button>

Last but not least, I have my router:

actions: {
     viewProject: function (project) {
         this.transitionToRoute('project', project);
     }
}

The component's action gets invoked correctly. However from there on, the action does not bubble up. Any ideas as to what I might be going wrong?

Aucun commentaire:

Enregistrer un commentaire