Last active
September 17, 2020 18:50
-
-
Save ggluta/25fffc8dbf889b3165fb277e4a5a79a6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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