2017-12-09 18:34:59 -05:00
|
|
|
import { ApplicationRef, NgModule } from "@angular/core";
|
2017-05-26 23:51:48 -04: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 18:34:59 -05:00
|
|
|
import { createNewHosts, removeNgStyles } from "@angularclass/hmr";
|
2017-05-26 23:51:48 -04:00
|
|
|
import { NgbModule } from "@ng-bootstrap/ng-bootstrap";
|
2017-05-27 03:27:36 -04:00
|
|
|
import { RiotComponent } from "./riot/riot.component";
|
2017-12-15 01:46:17 -05:00
|
|
|
import { ApiService } from "./shared/services/api.service";
|
2017-05-27 03:27:36 -04:00
|
|
|
import { UiSwitchModule } from "angular2-ui-switch";
|
2017-12-15 01:46:17 -05:00
|
|
|
import { ScalarService } from "./shared/services/scalar.service";
|
2017-05-27 19:45:07 -04:00
|
|
|
import { ToasterModule } from "angular2-toaster";
|
|
|
|
import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
|
2017-05-28 02:35:40 -04:00
|
|
|
import { IntegrationComponent } from "./integration/integration.component";
|
2017-05-28 02:53:12 -04:00
|
|
|
import { ScalarCloseComponent } from "./riot/scalar-close/scalar-close.component";
|
2017-12-15 01:46:17 -05:00
|
|
|
import { IntegrationService } from "./shared/services/integration.service";
|
2017-08-27 01:26:00 -04:00
|
|
|
import { BootstrapModalModule } from "ngx-modialog/plugins/bootstrap";
|
|
|
|
import { ModalModule } from "ngx-modialog";
|
2017-12-15 01:46:17 -05:00
|
|
|
import { IrcApiService } from "./shared/services/irc-api.service";
|
2017-10-09 22:49:26 -04:00
|
|
|
import { GenericWidgetWrapperComponent } from "./widget_wrappers/generic/generic.component";
|
2017-12-15 01:46:17 -05:00
|
|
|
import { ToggleFullscreenDirective } from "./shared/directives/toggle-fullscreen.directive";
|
2017-10-09 23:24:12 -04:00
|
|
|
import { FullscreenButtonComponent } from "./fullscreen-button/fullscreen-button.component";
|
2017-10-10 22:44:09 -04:00
|
|
|
import { VideoWidgetWrapperComponent } from "./widget_wrappers/video/video.component";
|
2017-12-10 02:59:36 -05:00
|
|
|
import { JitsiWidgetWrapperComponent } from "./widget_wrappers/jitsi/jitsi.component";
|
2017-12-11 19:29:57 -05:00
|
|
|
import { GCalWidgetWrapperComponent } from "./widget_wrappers/gcal/gcal.component";
|
2017-12-14 23:25:15 -05:00
|
|
|
import { PageHeaderComponent } from "./page-header/page-header.component";
|
|
|
|
import { SpinnerComponent } from "./spinner/spinner.component";
|
|
|
|
import { BreadcrumbsModule } from "ng2-breadcrumbs";
|
2017-12-15 01:41:56 -05:00
|
|
|
import { RiotHomeComponent } from "./riot/riot-home/home.component";
|
2017-05-26 23:51:48 -04:00
|
|
|
|
2017-12-10 04:35:24 -05:00
|
|
|
const WIDGET_CONFIGURATION_COMPONENTS: any[] = IntegrationService.getAllConfigComponents();
|
|
|
|
|
2017-05-26 23:51:48 -04:00
|
|
|
@NgModule({
|
|
|
|
imports: [
|
|
|
|
BrowserModule,
|
|
|
|
HttpModule,
|
|
|
|
FormsModule,
|
|
|
|
routing,
|
2017-05-27 03:27:36 -04:00
|
|
|
NgbModule.forRoot(),
|
|
|
|
UiSwitchModule,
|
2017-05-27 19:45:07 -04:00
|
|
|
ToasterModule,
|
|
|
|
BrowserAnimationsModule,
|
2017-05-29 00:51:04 -04:00
|
|
|
ModalModule.forRoot(),
|
|
|
|
BootstrapModalModule,
|
2017-12-14 23:25:15 -05:00
|
|
|
BreadcrumbsModule,
|
2017-05-26 23:51:48 -04:00
|
|
|
],
|
|
|
|
declarations: [
|
2017-12-10 04:35:24 -05:00
|
|
|
...WIDGET_CONFIGURATION_COMPONENTS,
|
2017-05-26 23:51:48 -04:00
|
|
|
AppComponent,
|
2017-05-27 03:27:36 -04:00
|
|
|
HomeComponent,
|
|
|
|
RiotComponent,
|
2017-05-28 02:35:40 -04:00
|
|
|
IntegrationComponent,
|
2017-12-14 23:25:15 -05:00
|
|
|
PageHeaderComponent,
|
|
|
|
SpinnerComponent,
|
2017-05-28 02:53:12 -04:00
|
|
|
ScalarCloseComponent,
|
2017-10-09 22:49:26 -04:00
|
|
|
GenericWidgetWrapperComponent,
|
2017-10-09 23:24:12 -04:00
|
|
|
ToggleFullscreenDirective,
|
|
|
|
FullscreenButtonComponent,
|
2017-10-10 22:44:09 -04:00
|
|
|
VideoWidgetWrapperComponent,
|
2017-12-10 02:59:36 -05:00
|
|
|
JitsiWidgetWrapperComponent,
|
2017-12-11 19:29:57 -05:00
|
|
|
GCalWidgetWrapperComponent,
|
2017-12-15 01:41:56 -05:00
|
|
|
RiotHomeComponent,
|
2017-05-27 03:27:36 -04:00
|
|
|
|
|
|
|
// Vendor
|
2017-05-26 23:51:48 -04:00
|
|
|
],
|
|
|
|
providers: [
|
2017-05-27 03:27:36 -04:00
|
|
|
ApiService,
|
2017-05-27 19:45:07 -04:00
|
|
|
ScalarService,
|
2017-05-29 00:51:04 -04:00
|
|
|
IntegrationService,
|
2017-06-10 20:58:05 -04:00
|
|
|
IrcApiService,
|
2017-10-09 22:26:46 -04:00
|
|
|
{provide: Window, useValue: window},
|
2017-05-27 03:27:36 -04:00
|
|
|
|
|
|
|
// Vendor
|
2017-05-26 23:51:48 -04:00
|
|
|
],
|
|
|
|
bootstrap: [AppComponent],
|
2017-05-29 00:51:04 -04:00
|
|
|
entryComponents: [
|
2017-12-10 04:35:24 -05:00
|
|
|
...WIDGET_CONFIGURATION_COMPONENTS,
|
2017-05-29 00:51:04 -04:00
|
|
|
]
|
2017-05-26 23:51:48 -04:00
|
|
|
})
|
|
|
|
export class AppModule {
|
|
|
|
constructor(public appRef: ApplicationRef) {
|
|
|
|
}
|
|
|
|
|
|
|
|
hmrOnInit(store) {
|
2017-08-27 01:26:00 -04:00
|
|
|
console.log("HMR store", store);
|
2017-05-26 23:51:48 -04: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;
|
|
|
|
}
|
|
|
|
}
|