W3cubDocs

/Ember.js

Ember.ActionHandler (private)

Defined in: packages/ember-runtime/lib/mixins/action_handler.js:9
Module: ember

send (actionName, context) public

actionName
String
The action to trigger
context
*
a context to send with the action

Triggers a named action on the ActionHandler. Any parameters supplied after the actionName string will be passed as arguments to the action target function.

If the ActionHandler has its target property set, actions may bubble to the target. Bubbling happens when an actionName can not be found in the ActionHandler's actions hash or if the action target function returns true.

Example

App.WelcomeRoute = Ember.Route.extend({
  actions: {
    playTheme() {
       this.send('playMusic', 'theme.mp3');
    },
    playMusic(track) {
      // ...
    }
  }
});

© 2017 Yehuda Katz, Tom Dale and Ember.js contributors
Licensed under the MIT License.
https://emberjs.com/api/ember/2.15/classes/Ember.ActionHandler/methods