Created
September 20, 2015 00:04
-
-
Save ErikCH/54bae0a93cd9195e1506 to your computer and use it in GitHub Desktop.
Ember Observer Example Part 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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