Skip to content

Instantly share code, notes, and snippets.

@ErikCH
Created September 20, 2015 00:04
Show Gist options
  • Save ErikCH/54bae0a93cd9195e1506 to your computer and use it in GitHub Desktop.
Save ErikCH/54bae0a93cd9195e1506 to your computer and use it in GitHub Desktop.
Ember Observer Example Part 2
export default Ember.Controller.extend({
appName:'Observer Example',
lambo: Car.create(),
status: computed('lambo.isOn', function() {
return "The lambo is " + (this.get('lambo').get('isOn') ? 'on' : 'off')
}),
actions: {
pressed: function() {
this.get('lambo').toggleProperty('isOn');
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment