Skip to content

Instantly share code, notes, and snippets.

@lifeart
Last active August 27, 2021 18:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lifeart/f459ef402c181077e83a377d6866b264 to your computer and use it in GitHub Desktop.
Save lifeart/f459ef402c181077e83a377d6866b264 to your computer and use it in GitHub Desktop.
Create Ember app inside ShadowRoot node
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