Created
March 13, 2012 02:54
-
-
Save elight/2026288 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// Pulled from http://emberjs.com/ | |
MyApp.president = Ember.Object.create({ | |
firstName: "Barack", | |
lastName: "Obama", | |
fullName: function() { | |
// Calls to get() can track the dependency (ala https://github.com/SteveSanderson/knockout/blob/master/src/subscribables/dependentObservable.js#L122) | |
return this.get('firstName') + ' ' + this.get('lastName'); | |
// Tell Ember that this function is a property | |
}.property(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment