Skip to content

Instantly share code, notes, and snippets.

@lydemann
Last active September 2, 2018 18:16
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 lydemann/80f9775393deca82092660f8d8508203 to your computer and use it in GitHub Desktop.
Save lydemann/80f9775393deca82092660f8d8508203 to your computer and use it in GitHub Desktop.
import { BrowserModule } from '@angular/platform-browser';
import { NgModule, Injector } from '@angular/core';
import { createCustomElement } from '@angular/elements';
import { HelloComponent } from './hello/hello.component';
@NgModule({
declarations: [
HelloComponent
],
imports: [
BrowserModule
],
providers: [],
entryComponents: [HelloComponent]
})
export class AppModule {
/**
*
*/
constructor(private injector: Injector) {
}
ngDoBootstrap() {
const helloComponentEl = createCustomElement(HelloComponent, { injector: this.injector });
customElements.define('hello', helloComponentEl);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment