Slide 41
Slide 41 text
:host { display: inline-block; }
class SwitchElement extends HTMLElement {
constructor() {
super();
const o = document.currentScript.ownerDocument;
const t = o.querySelector('template');
this.attachShadow({ mode: 'open' });
this.shadowRoot.appendChild(t.content.cloneNode(true));
}
}
customElements.define('switch-element', SwitchElement);