Passing arrays into attributes

902 views
Skip to first unread message

Filipe Araujo

unread,
Jul 23, 2014, 10:58:23 AM7/23/14
to polym...@googlegroups.com
I was looking at core-selector and it allows for  ".selected = ['x','x'], however setting the attribute to a string of that value does not function the same way.Is that accidental,  or is this an intended restriction?  If accidental, is there a convention for attributes with array / object values? 

Yvonne Yip

unread,
Jul 23, 2014, 4:16:49 PM7/23/14
to Filipe Araujo, polymer-dev
Hi,

If a Polymer element hints that the type of a property is an array or an object, you can use JSON strings in the attribute value. Example here: http://jsbin.com/noxof/1/edit


On Wed, Jul 23, 2014 at 7:58 AM, Filipe Araujo <filipe.al...@gmail.com> wrote:
I was looking at core-selector and it allows for  ".selected = ['x','x'], however setting the attribute to a string of that value does not function the same way.Is that accidental,  or is this an intended restriction?  If accidental, is there a convention for attributes with array / object values? 

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/0c9e0a1a-2f2b-454e-af93-166ce43b06fc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Arthur Evans

unread,
Jul 25, 2014, 4:12:46 PM7/25/14
to Yvonne Yip, Filipe Araujo, polymer-dev
Reply all
Reply to author
Forward
0 new messages