Application#customEvents

customEventsObjectpublic

Defined in packages/ember-application/lib/system/application.js:237

The DOM events for which the event dispatcher should listen.

By default, the application's Ember.EventDispatcher listens for a set of standard DOM events, such as mousedown and keyup, and delegates them to your application's Ember.View instances.

If you would like additional bubbling events to be delegated to your views, set your Ember.Application's customEvents property to a hash containing the DOM event name as the key and the corresponding view method name as the value. Setting an event to a value of null will prevent a default event listener from being added for that event.

To add new events to be listened to:

let App = Ember.Application.create({
  customEvents: {
    // add support for the paste event
    paste: 'paste'
  }
});

To prevent default events from being listened to:

let App = Ember.Application.create({
  customEvents: {
    // remove support for mouseenter / mouseleave events
    mouseenter: null,
    mouseleave: null
  }
});

Default: null

doc_EmberJs
2016-11-30 16:48:26
Comments
Leave a Comment

Please login to continue.