Simple global events service.
Adds Ember Evented Service to your routs, controllers and components
Service known as eventsBus
and globalEvents
ember install ember-cli-events-bus
my-component.js
...
actions: {
save() {
...
this.globalEvents.trigger('foo:bar', data)
// eq
this.eventsBus.trigger('foo:bar', data)
...
}
}
...
my-controller.js
...
init() {
...
this.globalEvents.on('foo:bar', this, 'bar')
// eq
this.eventsBus.on('foo:bar', this, 'bar')
...
},
bar(data) {
...
}
...