Last active
August 27, 2021 18:58
-
-
Save lifeart/f459ef402c181077e83a377d6866b264 to your computer and use it in GitHub Desktop.
Create Ember app inside ShadowRoot node
This file contains 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
class MyApp extends HTMLElement { | |
constructor() { | |
super(); | |
this.shadow = this.attachShadow({ mode: 'open' }); | |
this.shadow.classList = { | |
contains: () => { return false } | |
}; | |
} | |
connectedCallback() { | |
const node = document.createElement('div'); | |
this.shadow.appendChild(node); | |
createEmberApp(node); | |
} | |
} | |
customElements.define('my-app', MyApp); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment