src/service/template-impl.js
/**
   * Find a specified template inside the parent. Returns null if not present.
   * The template can be specified either via "template" attribute or as a
   * child "template" element. When specified via "template" attribute,
   * the value indicates the ID of the template element.
   * @param {!Element} parent
   * @return {?Element}
   * @private
   */
Find a specified template inside the parent. Returns null if not present.
The template can be specified either via "template" attribute or as a
child "template" element. When specified via "template" attribute,
the value indicates the ID of the template element.
@param {!Element} parent
@return {?Element}
@private
Find a specified template inside the parent . Returns null if not present . The template can be specified either via " template " attribute or as a child " template " element . When specified via " template " attribute the value indicates the ID of the template element . @param { !Element } parent @return { ?Element } @private
maybeFindTemplate_(parent) {
    const templateId = parent.getAttribute('template');
    if (templateId) {
      return parent.ownerDocument.getElementById(templateId);
    } else {
      return childElementByTag(parent, 'template');
    }
  }
maybeFindTemplate_ ( parent ) { const templateId = parent . getAttribute ( 'template' ) ; if ( templateId ) { return parent . ownerDocument . getElementById ( templateId ) ; } else { return childElementByTag ( parent , 'template' ) ; } }
Find a specified template inside the parent.
Find a specified template inside the parent .