Issue with vulcanized output of serialised JSON
On this page an example is given of passing a serialised JSON object to a web component. It uses this syntax:
<roster-list persons='[{"name": "John"}, {"name": "Bob"}]'></roster-list>
That works great (if I hint the attribute as a JavaScript array), but if I 'vulcanize' the page the output is:
<roster-list persons="[{"name": "John"}, {"name": "Bob"}]"></roster-list>
and the component doesn't work anymore. If you switch the single and double quotes, the vulcanized output is correct and the web component continues to work:
<roster-list persons="[{'name': 'John'}, {'name': 'Bob'}]"></roster-list>
(although that last syntax could also cause issues if you don't hint the variable and try to JSON.parse() it yourself: that won't work unless you replace the single by double quotes again)
Sorry about the confusion. The latter syntax is correct; HTML attributes require double quotes. Although many parsers are forgiving, vulcanize apparently isn't.
I'll make a note to correct the examples.
Closing this issue due to age and the release of version 1 of Polymer - please feel free to re-open if this is incorrect.