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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.