Route#send()

send (name, args) public

Inherited from Ember.ActionHandler but overwritten in packages/ember-routing/lib/system/route.js:1129

Sends an action to the router, which will delegate it to the currently active route hierarchy per the bubbling rules explained under actions.

Example

App.Router.map(function() {
  this.route('index');
});

App.ApplicationRoute = Ember.Route.extend({
  actions: {
    track: function(arg) {
      console.log(arg, 'was clicked');
    }
  }
});

App.IndexRoute = Ember.Route.extend({
  actions: {
    trackIfDebug: function(arg) {
      if (debug) {
        this.send('track', arg);
      }
    }
  }
});

Parameters:

name String
the name of the action to trigger
args ...*
doc_EmberJs
2016-11-30 16:53:13
Comments
Leave a Comment

Please login to continue.