Evented#on()

on (name, target, method) public 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. Parameters:

Evented#off()

off (name, target, method) public Defined in packages/ember-runtime/lib/mixins/evented.js:127 Cancels subscription for given name, target, and method. Parameters: name String The name of the event target Object The target of the subscription method Function The function of the subscription Returns: this

Evented#trigger()

trigger (name, args) public 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 Parameters: name String The name of the event args Object... Optional arguments to pass on

Evented

Ember.Evented Class PUBLIC Defined in: packages/ember-runtime/lib/mixins/evented.js:14 Module: ember-runtime This mixin allows for Ember objects to subscribe to and emit events. App.Person = Ember.Object.extend(Ember.Evented, { greet: function() { // ... this.trigger('greet'); } }); var person = App.Person.create(); person.on('greet', function() { console.log('Our person has greeted'); }); person.greet(); // outputs: 'Our person has greeted' You can also chain multiple e

EventDispatcher#setup()

setup (addedEvents) private Defined in packages/ember-views/lib/system/event_dispatcher.js:145 Sets up event listeners for standard browser events. This will be called after the browser sends a DOMContentReady event. By default, it will set up all of the listeners on the document body. If you would like to register the listeners on a different element, set the event dispatcher's root property. Parameters: addedEvents Object

EventDispatcher#setupHandler()

setupHandler (rootElement, event, eventName) private Defined in packages/ember-views/lib/system/event_dispatcher.js:184 Registers an event listener on the rootElement. If the given event is triggered, the provided event handler will be triggered on the target view. If the target view does not implement the event handler, or if the handler returns false, the parent view will be called. The event will continue to bubble to each successive parent view until it reaches the top. Parameters: r

EventDispatcher#rootElement

rootElementDOMElementprivate Defined in packages/ember-views/lib/system/event_dispatcher.js:94 The root DOM element to which event listeners should be attached. Event listeners will be attached to the document unless this is overridden. Can be specified as a DOMElement or a selector string. The default body is a string since this may be evaluated before document.body exists in the DOM. Default: 'body'

EventDispatcher#canDispatchToEventManager

canDispatchToEventManagerbooleanprivate Defined in packages/ember-views/lib/system/event_dispatcher.js:110 Available since 1.7.0 It enables events to be dispatched to the view's eventManager. When present, this object takes precedence over handling of events on the view itself. Note that most Ember applications do not use this feature. If your app also does not use it, consider setting this property to false to gain some performance improvement by allowing the EventDispatcher to skip the se

EventDispatcher

Ember.EventDispatcher Class PRIVATE Extends: Ember.Object Defined in: packages/ember-views/lib/system/event_dispatcher.js:22 Module: ember-views Ember.EventDispatcher handles delegating browser events to their corresponding Ember.Views. For example, when you click on a view, Ember.EventDispatcher ensures that that view's mouseDown method gets called.

EventDispatcher#registeredActions

registeredActionsObjectprivate Defined in packages/ember-views/lib/system/action_manager.js:8 Global action id hash.