Created
February 15, 2011 22:11
-
-
Save apike/828376 to your computer and use it in GitHub Desktop.
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 = SC.Object.create(); | |
MyApp.userController = SC.Object.create({ | |
name: null | |
}); | |
MyApp.manualView = SC.View.create({ | |
name: SC.Binding.from('MyApp.userController.name') | |
}); | |
MyApp.magicView = SC.View.create({ | |
nameBinding: "MyApp.userController.name" | |
}); | |
MyApp.userController.set('name', 'Joe'); | |
SC.RunLoop.begin(); | |
SC.RunLoop.end(); | |
console.log(MyApp.magicView.get('name')); // Prints 'Joe' | |
console.log(MyApp.manualView.get('name')); // Prints an SC.Mixin object |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment