Created
July 23, 2012 18:53
-
-
Save hyperqube/3165400 to your computer and use it in GitHub Desktop.
Emberjs Binding
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
MyApp.president = Ember.Object.create({ | |
name: "Barack Obama" | |
}); | |
MyApp.country = Ember.Object.create({ | |
// Ending a property with 'Binding' tells Ember to | |
// create a binding to the presidentName property. | |
presidentNameBinding: 'MyApp.president.name' | |
}); | |
// Later, after Ember has resolved bindings... | |
MyApp.country.get('presidentName'); | |
// "Barack Obama" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment