1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
| import { BrowserModule } from '@angular/platform-browser';
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { Injector } from '@angular/core';
import { createCustomElement } from '@angular/elements';
import { HttpClientModule } from '@angular/common/http';
import { FormsModule } from '@angular/forms';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { SortiesComponent } from './sorties/sorties.component';
import { NavbarComponent } from './navbar/navbar.component';
import { ApiSortiesService } from 'services/api.sorties.service';
import { SortieTriablesComponent } from './sortie-triables/sortie-triables.component';
import { Routes, RouterModule } from '@angular/router';
const appRoutes: Routes = [
{ path: 'sorties', component: SortiesComponent },
{ path: 'sortiestriables', component: SortieTriablesComponent }
];
@NgModule({
declarations: [AppComponent, ],
imports: [ BrowserModule, ],
//20220607 entryComponents : [ AppComponent, ],
entryComponents: [ButtonToggleMatComponent, AppComponent, ],
providers: [ ],
schemas: [ CUSTOM_ELEMENTS_SCHEMA, ],
})
export class AppModule {
constructor(private injector : Injector) {}
ngDoBootstrap(){
const el = createCustomElement(ButtonToggleMatComponent, {injector : this.injector});
customElements.define('angular', el);
}
} |