Created
October 7, 2011 05:19
-
-
Save ialexi/1269521 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
// I just found out that .bind automatically sets up chained bindings in SproutCore. When did that get added? | |
var data = SC.Object.create({ insideObject: SC.Object.create({ property: "Value" }) }); | |
var view = SC.Object.create(); | |
view.bind('prop', data, 'insideObject.property'); | |
// expected: | |
SC.RunLoop.end(); | |
console.log(view.get('prop')); // -> "Value" | |
// also expected: | |
data.setPath('insideObject.property', "Hi"); | |
SC.RunLoop.end(); | |
console.log(view.get('prop')); // -> "Hi" | |
// not expected: | |
data.set('insideObject', SC.Object.create({ property: "Hiyo!" })); | |
SC.RunLoop.end(); | |
console.log(view.get('prop')); // "Hiyo!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment