RSVP.EventTarget#trigger()

trigger (eventName, options) private

Defined in bower_components/rsvp/lib/rsvp/events.js:163

Use trigger to fire custom events. For example:

object.on('foo', function(){
  console.log('foo event happened!');
});
object.trigger('foo');
// 'foo event happened!' logged to the console

You can also pass a value as a second argument to trigger that will be passed as an argument to all event listeners for the event:

object.on('foo', function(value){
  console.log(value.name);
});

object.trigger('foo', { name: 'bar' });
// 'bar' logged to the console

Parameters:

eventName String
name of the event to be triggered
options *
optional value to be passed to any event handlers for the given `eventName`
doc_EmberJs
2016-11-30 16:53:23
Comments
Leave a Comment

Please login to continue.