2017-12-09 23:34:59 +00:00
|
|
|
import { ApplicationRef, NgModule } from "@angular/core";
|
2017-05-27 03:51:48 +00:00
|
|
|
import { BrowserModule } from "@angular/platform-browser";
|
|
|
|
import { HttpModule } from "@angular/http";
|
|
|
|
import { FormsModule } from "@angular/forms";
|
|
|
|
import { AppComponent } from "./app.component";
|
|
|
|
import { HomeComponent } from "./home/home.component";
|
|
|
|
import { routing } from "./app.routing";
|
2017-12-09 23:34:59 +00:00
|
|
|
import { createNewHosts, removeNgStyles } from "@angularclass/hmr";
|
2017-05-27 03:51:48 +00:00
|
|
|
import { NgbModule } from "@ng-bootstrap/ng-bootstrap";
|
2017-05-27 07:27:36 +00:00
|
|
|
import { RiotComponent } from "./riot/riot.component";
|
|
|
|
import { ApiService } from "./shared/api.service";
|
|
|
|
import { UiSwitchModule } from "angular2-ui-switch";
|
2017-05-27 23:45:07 +00:00
|
|
|
import { ScalarService } from "./shared/scalar.service";
|
|
|
|
import { ToasterModule } from "angular2-toaster";
|
|
|
|
import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
|
2017-05-28 06:35:40 +00:00
|
|
|
import { IntegrationComponent } from "./integration/integration.component";
|
2017-05-28 06:53:12 +00:00
|
|
|
import { ScalarCloseComponent } from "./riot/scalar-close/scalar-close.component";
|
2017-05-29 04:51:04 +00:00
|
|
|
import { IntegrationService } from "./shared/integration.service";
|
2017-08-27 05:26:00 +00:00
|
|
|
import { BootstrapModalModule } from "ngx-modialog/plugins/bootstrap";
|
|
|
|
import { ModalModule } from "ngx-modialog";
|
2017-06-11 00:58:05 +00:00
|
|
|
import { IrcApiService } from "./shared/irc-api.service";
|
2017-09-09 02:53:52 +00:00
|
|
|
import { MyFilterPipe } from "./shared/my-filter.pipe";
|
2017-10-10 02:49:26 +00:00
|
|
|
import { GenericWidgetWrapperComponent } from "./widget_wrappers/generic/generic.component";
|
2017-10-10 04:00:29 +00:00
|
|
|
import { ToggleFullscreenDirective } from "./shared/toggle-fullscreen.directive";
|
2017-10-10 03:24:12 +00:00
|
|
|
import { FullscreenButtonComponent } from "./fullscreen-button/fullscreen-button.component";
|
2017-10-11 02:44:09 +00:00
|
|
|
import { VideoWidgetWrapperComponent } from "./widget_wrappers/video/video.component";
|
2017-12-10 07:59:36 +00:00
|
|
|
import { JitsiWidgetWrapperComponent } from "./widget_wrappers/jitsi/jitsi.component";
|
2017-12-12 00:29:57 +00:00
|
|
|
import { GCalWidgetWrapperComponent } from "./widget_wrappers/gcal/gcal.component";
|
2017-05-27 03:51:48 +00:00
|
|
|
|
2017-12-10 09:35:24 +00:00
|
|
|
const WIDGET_CONFIGURATION_COMPONENTS: any[] = IntegrationService.getAllConfigComponents();
|
|
|
|
|
2017-05-27 03:51:48 +00:00
|
|
|
@NgModule({
|
|
|
|
imports: [
|
|
|
|
BrowserModule,
|
|
|
|
HttpModule,
|
|
|
|
FormsModule,
|
|
|
|
routing,
|
2017-05-27 07:27:36 +00:00
|
|
|
NgbModule.forRoot(),
|
|
|
|
UiSwitchModule,
|
2017-05-27 23:45:07 +00:00
|
|
|
ToasterModule,
|
|
|
|
BrowserAnimationsModule,
|
2017-05-29 04:51:04 +00:00
|
|
|
ModalModule.forRoot(),
|
|
|
|
BootstrapModalModule,
|
2017-05-27 03:51:48 +00:00
|
|
|
],
|
|
|
|
declarations: [
|
2017-12-10 09:35:24 +00:00
|
|
|
...WIDGET_CONFIGURATION_COMPONENTS,
|
2017-05-27 03:51:48 +00:00
|
|
|
AppComponent,
|
2017-05-27 07:27:36 +00:00
|
|
|
HomeComponent,
|
|
|
|
RiotComponent,
|
2017-05-28 06:35:40 +00:00
|
|
|
IntegrationComponent,
|
2017-05-28 06:53:12 +00:00
|
|
|
ScalarCloseComponent,
|
2017-09-09 02:53:52 +00:00
|
|
|
MyFilterPipe,
|
2017-10-10 02:49:26 +00:00
|
|
|
GenericWidgetWrapperComponent,
|
2017-10-10 03:24:12 +00:00
|
|
|
ToggleFullscreenDirective,
|
|
|
|
FullscreenButtonComponent,
|
2017-10-11 02:44:09 +00:00
|
|
|
VideoWidgetWrapperComponent,
|
2017-12-10 07:59:36 +00:00
|
|
|
JitsiWidgetWrapperComponent,
|
2017-12-12 00:29:57 +00:00
|
|
|
GCalWidgetWrapperComponent,
|
2017-05-27 07:27:36 +00:00
|
|
|
|
|
|
|
// Vendor
|
2017-05-27 03:51:48 +00:00
|
|
|
],
|
|
|
|
providers: [
|
2017-05-27 07:27:36 +00:00
|
|
|
ApiService,
|
2017-05-27 23:45:07 +00:00
|
|
|
ScalarService,
|
2017-05-29 04:51:04 +00:00
|
|
|
IntegrationService,
|
2017-06-11 00:58:05 +00:00
|
|
|
IrcApiService,
|
2017-10-10 02:26:46 +00:00
|
|
|
{provide: Window, useValue: window},
|
2017-05-27 07:27:36 +00:00
|
|
|
|
|
|
|
// Vendor
|
2017-05-27 03:51:48 +00:00
|
|
|
],
|
|
|
|
bootstrap: [AppComponent],
|
2017-05-29 04:51:04 +00:00
|
|
|
entryComponents: [
|
2017-12-10 09:35:24 +00:00
|
|
|
...WIDGET_CONFIGURATION_COMPONENTS,
|
2017-05-29 04:51:04 +00:00
|
|
|
]
|
2017-05-27 03:51:48 +00:00
|
|
|
})
|
|
|
|
export class AppModule {
|
|
|
|
constructor(public appRef: ApplicationRef) {
|
|
|
|
}
|
|
|
|
|
|
|
|
hmrOnInit(store) {
|
2017-08-27 05:26:00 +00:00
|
|
|
console.log("HMR store", store);
|
2017-05-27 03:51:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
hmrOnDestroy(store) {
|
|
|
|
let cmpLocation = this.appRef.components.map(cmp => cmp.location.nativeElement);
|
|
|
|
// recreate elements
|
|
|
|
store.disposeOldHosts = createNewHosts(cmpLocation);
|
|
|
|
// remove styles
|
|
|
|
removeNgStyles();
|
|
|
|
}
|
|
|
|
|
|
|
|
hmrAfterDestroy(store) {
|
|
|
|
// display new elements
|
|
|
|
store.disposeOldHosts();
|
|
|
|
delete store.disposeOldHosts;
|
|
|
|
}
|
|
|
|
}
|