Created
February 18, 2014 16:23
-
-
Save opichals/9074197 to your computer and use it in GitHub Desktop.
ObjectProxy.unknownProperty definesProperty
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
var content = Em.Object.create({ | |
x: 1, | |
y: 2, | |
z: 0 | |
}); | |
var op = Em.ObjectProxy.createWithMixins({ | |
content: content, | |
yBinding: 'x', | |
_xDidChange: function() { | |
this.set('z', this.get('x')); | |
}.observes('x') | |
}); | |
Em.run.sync(); | |
alert(Em.inspect({content: Em.inspect(content.getProperties('x', 'y', 'z')), op: Em.inspect(op.getProperties('x', 'y', 'z'))})); | |
op.set('x', 3); | |
Em.run.sync(); | |
// note the content.y not being propagated from the op | |
// caused by https://github.com/emberjs/ember.js/commit/8da6cb5d6a22687bb2409c43da582c95ab8e6744 | |
// | |
alert(Em.inspect({content: Em.inspect(content.getProperties('x', 'y', 'z')), op: Em.inspect(op.getProperties('x', 'y', 'z'))})); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment