Skip to content

Instantly share code, notes, and snippets.

@vire
Created March 30, 2015 10:40
Show Gist options
  • Save vire/2ce107c3ec5545e77923 to your computer and use it in GitHub Desktop.
Save vire/2ce107c3ec5545e77923 to your computer and use it in GitHub Desktop.
let MyCar = Ember.Object.extend(Ember.Evented, {
turnLightsOn: function() {
this.set('lightsOn', true);
}.on('engineStart'),
turnLigthsOff: function() {
this.set('lightsOn', false);
}.on('engineStop'),
start: function() {
// do stuff
this.trigger('engineStart');
},
stop: function() {
// do stuff
this.trigger('engineStop');
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment