bind array into polymer element attribute

585 views
Skip to first unread message

lege...@gmail.com

unread,
Feb 6, 2014, 1:37:50 PM2/6/14
to polym...@googlegroups.com

I'm try to bind array into polymer-list data attribute.
But it binds as string '[object Object],[object Object]'.
This not happends when polymer element is inside another polymer element, but only when polymer element is inside my custom element.
As I understand template binding should call bind method from polymer mdv that allow to bind arrays and object.
But in this case it calls original HTMLELement.bind instead.

Why this happens? Can anybody help me?

John Messerly

unread,
Feb 6, 2014, 1:56:48 PM2/6/14
to lege...@gmail.com, polymer-dev
Interesting issue. I think I can help, but I will need to debug a working example to understand what is happening. Would it be possible to show a code sample?



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/3e6013df-e244-471e-a65c-6f7f787940d9%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Steve Orvell

unread,
Feb 6, 2014, 1:58:27 PM2/6/14
to John Messerly, lege...@gmail.com, polymer-dev
Thanks for the test case.

Polymer elements loaded at page load are not ready until the 'polymer-ready' event is fired. Here, you're registering x-test and making one before polymer-list has been registered. This means the polymer-list that's being bound in x-test's createdCallback is an unknown element and does not have the proper implementation of bind. The solution here is to wait until polymer-ready to depend on a polymer element. One more thing, you'll need to give polymer-list a height to see the content.

Here's an example:


John Messerly

unread,
Feb 6, 2014, 2:01:10 PM2/6/14
to Steve Orvell, lege...@gmail.com, polymer-dev
Thanks Steve... And my apologies to legendar for not seeing your example link. *facepalm* :)

lege...@gmail.com

unread,
Feb 6, 2014, 4:08:17 PM2/6/14
to polym...@googlegroups.com, lege...@gmail.com
Thank you very much for save my time and for this cool library =)

четверг, 6 февраля 2014 г., 20:37:50 UTC+2 пользователь lege...@gmail.com написал:
Reply all
Reply to author
Forward
0 new messages