To test individual insulating elements from the polymer separately, I would like to be able to pass object literals to js for some attributes that usually come from parent elements. Itβs hard for me to figure out how to do this. See this sample code. If it worked as I would like, it would display 1 and 2 next to each other, but that didn't work.
<script src="http://www.polymer-project.org/webcomponents.js"></script> <link rel="import" href="http://www.polymer-project.org/components/polymer/polymer.html"> <polymer-element name="my-element" attributes="stuff"> <template> {{stuff.one}} {{stuff.two}} </template> <script> Polymer('my-element', { ready: function () { console.log(this.stuff); } }); </script> </polymer-element> <my-element stuff='{"one": 1, "two": 2}'></my-element>
javascript polymer web-component
cayblood
source share