Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
29 lines (24 sloc) 893 Bytes
import { BrowserModule } from "@angular/platform-browser";
import { NgModule, Injector } from "@angular/core";
import { createCustomElement } from "@angular/elements";
import { HttpClientModule } from "@angular/common/http";
import { AppComponent } from "./app.component";
import { TodoListComponent } from "./todo-list/todo-list.component";
@NgModule({
declarations: [AppComponent, TodoListComponent],
imports: [BrowserModule, HttpClientModule],
providers: [],
/** We no more need bootstrap the app component */
// bootstrap: [AppComponent],
/** Declare todo list component as entryComponents */
entryComponents: [TodoListComponent]
})
export class AppModule {
constructor(private injector: Injector) {}
ngDoBootstrap() {
const el = createCustomElement(TodoListComponent, {
injector: this.injector
});
customElements.define("my-todo-list", el);
}
}
You can’t perform that action at this time.