Defined in: | packages/ember-runtime/lib/mixins/evented.js:14 |
---|---|
Module: | ember |
Defined in packages/ember-runtime/lib/mixins/evented.js:142
Checks to see if object has any subscriptions for named event.
Defined in packages/ember-runtime/lib/mixins/evented.js:127
Cancels subscription for given name, target, and method.
Defined in packages/ember-runtime/lib/mixins/evented.js:52
Subscribes to a named event with given function.
person.on('didLoad', function() { // fired once the person has loaded });
An optional target can be passed in as the 2nd argument that will be set as the "this" for the callback. This is a good way to give your function access to the object triggering the event. When the target parameter is used the callback becomes the third argument.
Defined in packages/ember-runtime/lib/mixins/evented.js:78
Subscribes a function to a named event and then cancels the subscription after the first time the event is triggered. It is good to use one
when you only care about the first time an event has taken place.
This function takes an optional 2nd argument that will become the "this" value for the callback. If this argument is passed then the 3rd argument becomes the function.
Defined in packages/ember-runtime/lib/mixins/evented.js:104
Triggers a named event for the object. Any additional arguments will be passed as parameters to the functions that are subscribed to the event.
person.on('didEat', function(food) { console.log('person ate some ' + food); }); person.trigger('didEat', 'broccoli'); // outputs: person ate some broccoli
© 2017 Yehuda Katz, Tom Dale and Ember.js contributors
Licensed under the MIT License.
https://emberjs.com/api/ember/2.15/classes/Ember.Evented/methods