Polymer 0.8 x-autobind

161 views
Skip to first unread message

frederi...@gmail.com

unread,
Mar 11, 2015, 7:51:26 AM3/11/15
to polym...@googlegroups.com
Hi All,

I'm doing some experiments with the 0.8-preview branch and I'm having and issue with the x-autobind template:
<body>
  <template is="x-autobind">
    <input type="number" min="0" max="100" step="1" value="{{val}}">
    <input type="range"  min="0" max="100" step="1" value="{{val}}">
  </template>

  <script>
    var template = document.querySelector('template');
    template.val = 42;
  </script>
</body>


The initial value (42) is correctly set on both inputs but the property is not bound. The same code works as expected with 0.5.5 (auto-binding template).

fredj



Arthur Evans

unread,
Mar 13, 2015, 1:12:04 PM3/13/15
to frederi...@gmail.com, polymer-dev
Data binding in 0.8 is one-way by default, so value changes aren't going to be propagated back to `val`. When creating an element, you can declare a property that's two-way bindable (by setting `notify: true`). There's no way to declare this on an x-autobind element.

That said, all of the x- elements are experimental (when they reach a more complete/final form, they'll be renamed). If you feel like there are crucial missing features, I'd recommend filing a bug or feature request.

- 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/2b74677e-9ecf-436b-b08d-2bbb79d49b69%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

frederi...@gmail.com

unread,
Mar 16, 2015, 4:06:54 AM3/16/15
to polym...@googlegroups.com, frederi...@gmail.com
Thanks for the response.
Reply all
Reply to author
Forward
0 new messages