EmberJS actions – call one action from another when wrapped within `actions`

You can use the send(actionName, arguments) method.

App.IndexController = Ember.ArrayController.extend({
    actions: {
        actionFoo: function() {
            alert('foo');
            this.send('actionBar');
        },
        actionBar: function() {
            alert('bar');
        }
    }
});

Here is a jsfiddle with this sample http://jsfiddle.net/marciojunior/pxz4y/

Leave a Comment