Skip to content

Instantly share code, notes, and snippets.

@hetdev
Last active August 27, 2019 16:33
Show Gist options
  • Save hetdev/069c173e7f17ee32fb038bce112e2500 to your computer and use it in GitHub Desktop.
Save hetdev/069c173e7f17ee32fb038bce112e2500 to your computer and use it in GitHub Desktop.
import { BrowserModule } from '@angular/platform-browser';
import {DoBootstrap, Injector, NgModule} from '@angular/core';
import { AppComponent } from './app.component';
import {createCustomElement} from '@angular/elements';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule
],
providers: [],
// bootstrap: [AppComponent],
entryComponents: [
AppComponent
]
})
export class AppModule implements DoBootstrap {
constructor(private injector: Injector) {
}
ngDoBootstrap() {
const el = createCustomElement(AppComponent, { injector: this.injector });
customElements.define('phoenix-wc-wiki-ngx', el);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment