Skip to content

Instantly share code, notes, and snippets.

@siddharthpal
Last active October 13, 2019 16:46
Show Gist options
  • Save siddharthpal/4fedff8d4c9d4a04d22a696ccf127d77 to your computer and use it in GitHub Desktop.
Save siddharthpal/4fedff8d4c9d4a04d22a696ccf127d77 to your computer and use it in GitHub Desktop.
Compiling Angular Component to Custom Element
@NgModule({
imports: [BrowserModule, TodoModule],
entryComponents: [TodoComponent]
})
export class TodoWrapperModule {
constructor(private injector: Injector) {
const todoElement = createCustomElement(TodoComponent, {
injector: this.injector
});
customElements.define('todo-root-angular-element', todoElement);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment