Bug/Feature on polymer.concat.js when propagating value changes

26 views
Skip to first unread message

Leandro Cruz

unread,
Oct 20, 2014, 2:01:55 PM10/20/14
to polym...@googlegroups.com
Hi all. I think I found a bug polymer.concat.js setValueFrom(). It updates the value of an attribute object when propagating a change. 
The "reproducer" is called bug.html. If you run it, it will show my name 'Leandro Rodrigo Saad Cruz' which came from object x. Now, if you set a new value using the set button, x.name is updated too.
Not sure if it's a bug or a feature? What do you say?

Cheers!

bug.html
sample.html

Arthur Evans

unread,
Oct 20, 2014, 8:00:26 PM10/20/14
to Leandro Cruz, polymer-dev
This is a feature -- this is why it's called two-way data binding. Your <my-sample> element publishes a property called `param` and the 
<my-input> element is binding that to `input.name`.

In fact, if you change your input element to:

<input id="in" value="{{param}}"/>

You can remove the button and on-click handler, and the values will be updated whenever the input's value changes.


Cheers,
Arthur



Follow Polymer on Google+: plus.google.com/107187849809354688692
---
You received this message because you are subscribed to the Google Groups "Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to polymer-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/polymer-dev/92cde8f3-cf93-4b10-b338-51636a953129%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages