Polymer - how to create element with binding
问题 I need to create polymer custom element with binding attribute. <foo-bar baz="{{qux}}"></foo-bar> It's OK. But it must be created dynamically (tagName passed as an attribute). I try this Polymer({ ready: function() { var element = document.createElement(this.tagName); element.setAttribute('baz', '{{qux}}'); this.$.placeholder.appendChild(element); } }); But it does not work. How can I do that? 回答1: You can do this with injectBoundHTML() : <div id="container"></div> ... this.injectBoundHTML('