Permalink
Cannot retrieve contributors at this time
Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign up
Fetching contributors…
| 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); | |
| } | |
| } |