Skip to content

Instantly share code, notes, and snippets.

@ggluta
Last active September 17, 2020 18:50
Show Gist options
  • Save ggluta/25fffc8dbf889b3165fb277e4a5a79a6 to your computer and use it in GitHub Desktop.
Save ggluta/25fffc8dbf889b3165fb277e4a5a79a6 to your computer and use it in GitHub Desktop.
// STEP 2 - DEFININING COMPONENT BEHAVIOUR
class AwesomeComponent extends HTMLElement {
constructor() {
super();
// enables to access the shadowDom through the shadowRoot
const shadow = this.attachShadow({ mode: 'open' });
// we are going to attach the template to the shadowRoot ( || shadowDOM)
shadow.appendChild(template.content.cloneNode(true));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment