Skip to content

Instantly share code, notes, and snippets.

@elight
Created March 13, 2012 02:54
Show Gist options
  • Save elight/2026288 to your computer and use it in GitHub Desktop.
Save elight/2026288 to your computer and use it in GitHub Desktop.
// 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