-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Computed property can't be data-bound from outside #638
Comments
I think we need to make this work, but it'll require some more sophistication in the binding system. Right now a computed property is essentially 'bound' to the computation of its value. |
I suggest documenting how it works now. I think we can call this out as a On Wed, Jul 16, 2014 at 5:29 PM, Arthur Evans notifications@github.com
|
I think we should definitely document it now. Many people have asked about
|
@sorvell just got me up to speed on this. I can take a look. The issue is that computed properties are treated as a property binding (bindToAccessor) so they collide: |
John, I actually prepared a patch for this prior to I/O, but the team didn't want any more changes while they were trying to stabilize: https://codereview.appspot.com/102290043/. If you want to take over this patch, I doubt landing it will be very hard. |
oh, awesome! Thanks for sending that my way! |
... and if you wanted to land it that works for me too :). But in case it requires merging I'm happy to revive it! |
<happy-dance> !!! </happy-dance> |
hmmm. I'm a little confused, but your original jsbin still seems to be failing even after the fix. Maybe it's an issue with how the fix interacts with auto-binding. Just a guess because that's one difference between your jsbin compared to the test that was added. |
Ah, nevermind, it looks like there was an (unrelated) change where computed properties are not considered "published" automatically. If I add "reversedvalue" to attributes= it works: http://jsbin.com/curiwocomopa/1/edit |
Ah, yeah. I documented it that way: http://www.polymer-project.org/docs/polymer/polymer.html#computed-properties One extra step, but it seems reasonable that you might not want to publish every computed property. |
When using a computed property, I can data bind it inside the element's template. However, it doesn't appear to be published such that an outside element can bind to it.
Test case:
http://jsbin.com/jifon/3/edit
The binding inside the element's template shows up. However, binding to it in the auto-binding template doesn't work. (Filtered value never appears.)
This seems wrong -- @rafaelw?
The text was updated successfully, but these errors were encountered: