Although, as a technical expert said, he is still not very well supported. This seems to do the trick.
function injectBoundHTML(html, element) { var template = document.createElement('template', 'dom-bind'); var doc = template.content.ownerDocument; var div = doc.createElement('div'); div.innerHTML = html; template.content.appendChild(div); while (element.firstChild) { element.removeChild(element.firstChild); } element.appendChild(Polymer.Base.instanceTemplate(template)); }
If your HTML has already been parsed, use something like "doc.importNode (sourceNode, true)"; instead of getting / setting innerHTML.
Mark doyle
source share