2017-12-22 23:08:10 -05:00
|
|
|
import { ApplicationRef, Injector, 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";
|
|
|
|
import { UiSwitchModule } from "angular2-ui-switch";
|
2017-12-20 23:28:43 -05:00
|
|
|
import { ScalarClientApiService } from "./shared/services/scalar-client-api.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:53:12 -04:00
|
|
|
import { ScalarCloseComponent } from "./riot/scalar-close/scalar-close.component";
|
2017-08-27 01:26:00 -04:00
|
|
|
import { BootstrapModalModule } from "ngx-modialog/plugins/bootstrap";
|
|
|
|
import { ModalModule } from "ngx-modialog";
|
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-12-22 23:08:10 -05:00
|
|
|
import { FullscreenButtonComponent } from "./elements/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";
|
2017-12-22 23:08:10 -05:00
|
|
|
import { SpinnerComponent } from "./elements/spinner/spinner.component";
|
2017-12-14 23:25:15 -05:00
|
|
|
import { BreadcrumbsModule } from "ng2-breadcrumbs";
|
2017-12-15 01:41:56 -05:00
|
|
|
import { RiotHomeComponent } from "./riot/riot-home/home.component";
|
2017-12-15 23:22:34 -05:00
|
|
|
import { IntegrationBagComponent } from "./integration-bag/integration-bag.component";
|
|
|
|
import { IntegrationComponent } from "./integration/integration.component";
|
2017-12-20 23:28:43 -05:00
|
|
|
import { ScalarServerApiService } from "./shared/services/scalar-server-api.service";
|
|
|
|
import { DimensionApiService } from "./shared/services/dimension-api.service";
|
|
|
|
import { AdminApiService } from "./shared/services/admin-api.service";
|
2017-12-22 23:08:10 -05:00
|
|
|
import { ServiceLocator } from "./shared/services/locator.service";
|
|
|
|
import { IboxComponent } from "./elements/ibox/ibox.component";
|
2017-12-22 23:33:37 -05:00
|
|
|
import { CustomWidgetConfigComponent } from "./configs/widget/custom/custom.widget.component";
|
2017-12-10 04:35:24 -05:00
|
|
|
|
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: [
|
|
|
|
AppComponent,
|
2017-05-27 03:27:36 -04:00
|
|
|
HomeComponent,
|
|
|
|
RiotComponent,
|
2017-05-28 02:35:40 -04:00
|
|
|
IntegrationComponent,
|
2017-12-15 23:22:34 -05:00
|
|
|
IntegrationBagComponent,
|
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-12-22 23:08:10 -05:00
|
|
|
IboxComponent,
|
2017-12-22 23:33:37 -05:00
|
|
|
CustomWidgetConfigComponent,
|
2017-05-27 03:27:36 -04:00
|
|
|
|
|
|
|
// Vendor
|
2017-05-26 23:51:48 -04:00
|
|
|
],
|
|
|
|
providers: [
|
2017-12-20 23:28:43 -05:00
|
|
|
ScalarClientApiService,
|
|
|
|
ScalarServerApiService,
|
|
|
|
DimensionApiService,
|
|
|
|
AdminApiService,
|
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-12-22 23:08:10 -05:00
|
|
|
entryComponents: []
|
2017-05-26 23:51:48 -04:00
|
|
|
})
|
|
|
|
export class AppModule {
|
2017-12-22 23:08:10 -05:00
|
|
|
constructor(public appRef: ApplicationRef, injector: Injector) {
|
|
|
|
ServiceLocator.injector = injector;
|
2017-05-26 23:51:48 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|