import { BrowserModule } from '@angular/platform-browser' ; import { NgModule , Injector } from '@angular/core' ; import { AppRoutingModule } from './app-routing.module' ; import { AppComponent } from './app.component' ; import { createCustomElement } from '@angular/elements' ; import { BookingComponent } from './booking/booking.component' ; @ NgModule ( { declarations : [ AppComponent , BookingComponent ] , imports : [ BrowserModule , AppRoutingModule ] , providers : [ ] , bootstrap : [ ] , entryComponents : [ BookingComponent ] } ) export class AppModule { constructor ( private injector ) { } ngDoBootstrap ( ) { const myCustomElement = createCustomElement ( BookingComponent , { injector : this . injector } ) ; customElements . define ( 'app-train-booking' , myCustomElement ) ; } }