packages/basic-component-mixins/src/ShadowTemplateMixin.js
function createTemplateWithInnerHTML(innerHTML) {
  const template = document.createElement('template');
  // REVIEW: Is there an easier way to do this?
  // We'd like to just set innerHTML on the template content, but since it's
  // a DocumentFragment, that doesn't work.
  const div = document.createElement('div');
  div.innerHTML = innerHTML;
  while (div.childNodes.length > 0) {
    template.content.appendChild(div.childNodes[0]);
  }
  return template;
}
function createTemplateWithInnerHTML(innerHTML) {
  const template = document.createElement('template');
  // REVIEW: Is there an easier way to do this?
  // We'd like to just set innerHTML on the template content, but since it's
  // a DocumentFragment, that doesn't work.
  const div = document.createElement('div');
  div.innerHTML = innerHTML;
  while (div.childNodes.length > 0) {
    template.content.appendChild(div.childNodes[0]);
  }
  return template;
}
function createTemplateWithInnerHTML ( innerHTML ) { const template = document . createElement ( 'template' ) ; // REVIEW: Is there an easier way to do this? // We'd like to just set innerHTML on the template content, but since it's // a DocumentFragment, that doesn't work. const div = document . createElement ( 'div' ) ; div . innerHTML = innerHTML ; while ( div . childNodes . length > 0 ) { template . content . appendChild ( div . childNodes [ 0 ] ) ; } return template ; }
Convert a plain string of HTML into a real template element.
Convert a plain string of HTML into a real template element .