-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.module.ts
More file actions
62 lines (50 loc) · 1.78 KB
/
app.module.ts
File metadata and controls
62 lines (50 loc) · 1.78 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import { Type, Injector, NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { HttpClientModule } from '@angular/common/http';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { createCustomElement } from '@angular/elements';
import { HeadermenuComponent } from './components/menus/headermenu/headermenu.component';
import { PageComponent } from './pages/page/page.component';
import { ButtonComponent } from './components/button/button.component';
import { WorkshoplistComponent } from './workshoplist/workshoplist.component';
import { TimeplanComponent } from './timeplan/timeplan.component';
import { GalleryComponent } from './gallery/gallery.component';
import { TestGalleryComponent } from './pages/test-gallery/test-gallery.component';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
@NgModule({
declarations: [
AppComponent,
TimeplanComponent,
WorkshoplistComponent,
GalleryComponent,
HeadermenuComponent,
PageComponent,
ButtonComponent,
TestGalleryComponent,
],
imports: [
BrowserModule,
HttpClientModule,
AppRoutingModule,
BrowserAnimationsModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule {
private components: WebComponent[] = [
{tag: 'dd-timeplan', type: TimeplanComponent},
{tag: 'dd-workshoplist', type: WorkshoplistComponent},
{tag: 'dd-gallery', type: GalleryComponent}
];
constructor(private injector: Injector) {
this.components.forEach((component: WebComponent) => {
customElements.define(component.tag, createCustomElement(component.type, { injector }));
});
}
}
interface WebComponent {
tag: string;
type: Type<any>
}