How do you call one action from another action when wrapped within actions
in an EmberJS controller?
Original code that uses the now deprecated way to defin
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/