src/ui/components/component.js
function getTemplate() {
    const tagName = this.tagName.toLocaleLowerCase();

    if (ComponentsHash[tagName].style) {
      const styleNode = document.createElement('style');
      styleNode.id = 'style-' + this.tagName.toLowerCase();
      styleNode.innerHTML = ComponentsHash[tagName].style;
      document.getElementsByTagName('head')[0].appendChild(styleNode);
      ComponentsHash[tagName].style = ''; // insure it doesn't get added to head a second time
    }
    return ComponentsHash[tagName].template;
  }
function getTemplate() {
    const tagName = this.tagName.toLocaleLowerCase();

    if (ComponentsHash[tagName].style) {
      const styleNode = document.createElement('style');
      styleNode.id = 'style-' + this.tagName.toLowerCase();
      styleNode.innerHTML = ComponentsHash[tagName].style;
      document.getElementsByTagName('head')[0].appendChild(styleNode);
      ComponentsHash[tagName].style = ''; // insure it doesn't get added to head a second time
    }
    return ComponentsHash[tagName].template;
  }
function getTemplate ( ) { const tagName = this . tagName . toLocaleLowerCase ( ) ; if ( ComponentsHash [ tagName ] . style ) { const styleNode = document . createElement ( 'style' ) ; styleNode . id = 'style-' + this . tagName . toLowerCase ( ) ; styleNode . innerHTML = ComponentsHash [ tagName ] . style ; document . getElementsByTagName ( 'head' ) [ 0 ] . appendChild ( styleNode ) ; ComponentsHash [ tagName ] . style = '' ; // insure it doesn't get added to head a second time } return ComponentsHash [ tagName ] . template ; }
Return the template for this Component.

Get the default template:

```
var template = widget.getTemplate();
```

Typical components should not need to call this; this will be called automatically prior to calling the Component's `created` method.
Some components wanting to reset dom to initial state may use this method explicitly:

```
var template = this.getTemplate();
var clone = document.importNode(template.content, true);
this.appendChild(clone);
this.setupDomNodes();
```

@method getTemplate
@protected
@returns {HTMLTemplateElement}
Return the template for this Component .