OpenSlides/client/src/app/core/core.module.ts

49 lines
1.7 KiB
TypeScript
Raw Normal View History

import { NgModule, Optional, SkipSelf } from '@angular/core';
import { CommonModule } from '@angular/common';
import { Title } from '@angular/platform-browser';
// Core Services, Directives
import { AuthGuard } from './services/auth-guard.service';
import { AuthService } from './services/auth.service';
import { AutoupdateService } from './services/autoupdate.service';
2018-08-22 16:03:49 +02:00
import { DataStoreService } from './services/data-store.service';
import { OperatorService } from './services/operator.service';
import { WebsocketService } from './services/websocket.service';
2018-08-22 16:03:49 +02:00
import { DataSendService } from './services/data-send.service';
import { ViewportService } from './services/viewport.service';
2018-10-01 15:36:16 +02:00
import { PromptDialogComponent } from '../shared/components/prompt-dialog/prompt-dialog.component';
import { HttpService } from './services/http.service';
2018-11-27 22:44:37 +01:00
import { ChoiceDialogComponent } from '../shared/components/choice-dialog/choice-dialog.component';
/** Global Core Module. Contains all global (singleton) services
*
*/
@NgModule({
imports: [CommonModule],
providers: [
Title,
AuthGuard,
AuthService,
AutoupdateService,
DataStoreService,
2018-08-22 16:03:49 +02:00
DataSendService,
HttpService,
OperatorService,
ViewportService,
2018-11-16 16:09:15 +01:00
WebsocketService
2018-10-01 15:36:16 +02:00
],
2018-11-27 22:44:37 +01:00
entryComponents: [PromptDialogComponent, ChoiceDialogComponent]
})
export class CoreModule {
/** make sure CoreModule is imported only by one NgModule, the AppModule */
2018-08-29 13:21:25 +02:00
public constructor(
@Optional()
@SkipSelf()
parentModule: CoreModule
) {
if (parentModule) {
throw new Error('CoreModule is already loaded. Import only in AppModule');
}
}
}