Function#on()

onpublic

Defined in packages/ember-runtime/lib/ext/function.js:162

The on extension of Javascript's Function prototype is available when EmberENV.EXTEND_PROTOTYPES or EmberENV.EXTEND_PROTOTYPES.Function is true, which is the default.

You can listen for events simply by adding the on call to the end of your method declarations in classes or mixins that you write. For example:

Ember.Mixin.create({
  doSomethingWithElement: function() {
    // Executes whenever the "didInsertElement" event fires
  }.on('didInsertElement')
});

See Ember.on.

doc_EmberJs
2016-11-30 16:52:08
Comments
Leave a Comment

Please login to continue.