Hi Michael,

There's a branch of 0.8 where work is being done to let you specify an
event that will trigger an update of a binding. This will let you make
two-way bindings to native elements, and custom elements that don't follow
Polymer's event firing and naming conventions.

I'm not 100% sure, but I think the syntax right now looks like this:

<input value="{{data.name::change}}">

where the "::change" part basically means "on 'change' events, read the
'value' property and write it to the binding"

Not sure when this will land in 0.8, probably soon. You can file an issue
and we'll notify it when it's in.

Cheers!
  Justin




On Sat, Mar 28, 2015 at 9:35 PM, Aleks Totic <ato...@gmail.com> wrote:

> firebase port is not straightforward. Firebase-element uses observers to
> detect changes for auto-save, and the observers are not used in 0.8. I
> would not start porting until I fully understand 0.8 data flow.
>
> As for your question:
>
> In 0.5, property binding used observers. Which was lovely, the model and
> the editor did not need to know anything about each other, everything just
> worked
> In 0.8, property binding is implemented using custom events to broadcast
> poperty changes. Native tags like <input> do not broadcast these custom
> events. So, you'd have to do something like this:
>
> <input on-change='handleChange'>
>
> handleChange: function() {
>     firebaseElement.setPath('data.name', this.$.input.value);
> }
>
> Which is a lot more verbose than it used to be. This area is still in a
> lot of flux.
>
> Aleks
>
>
> On Saturday, March 28, 2015 at 2:09:55 PM UTC-7, Michael Bleigh wrote:
>>
>> I started trying to port firebase-element to 0.8
>> <https://github.com/Polymer/firebase-element/pull/46> and got stuck on
>> simple two-way binding to input values. Is two-way binding only supported
>> via custom elements in 0.8? How would I do the equivalent of this in 0.5:
>>
>> <firebase-element location="https://example.firebaseio.com/demo"; data=
>> "{{data}}"></firebase-element>
>>
>> <input value="{{data.name}}">
>>
>> Or, if that ought to work properly can you take a look at this example
>> <https://github.com/Polymer/firebase-element/blob/master/demos/firebase.html>
>> and tell me what's wrong with it?
>>
>> Cheers,
>> Michael Bleigh
>>
>  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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/polymer-dev/2c34bd26-f6b0-4fa7-a6d3-219694f4392b%40googlegroups.com
> <https://groups.google.com/d/msgid/polymer-dev/2c34bd26-f6b0-4fa7-a6d3-219694f4392b%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/polymer-dev/CAEKsHmD0vFM0%2BvQmhgeHYje-iuFOHowO-rZm94sewdJU0uD%2BqA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to