2018-07-23 16:42:17 +02:00
|
|
|
import { CommonModule } from '@angular/common';
|
2019-07-26 11:46:59 +02:00
|
|
|
import { NgModule, Optional, SkipSelf, Type } from '@angular/core';
|
2018-07-23 16:42:17 +02:00
|
|
|
import { Title } from '@angular/platform-browser';
|
|
|
|
|
2019-01-10 15:06:10 +01:00
|
|
|
import { ProjectionDialogComponent } from 'app/shared/components/projection-dialog/projection-dialog.component';
|
2019-07-26 11:46:59 +02:00
|
|
|
import { ChoiceDialogComponent } from '../shared/components/choice-dialog/choice-dialog.component';
|
2019-02-01 13:56:08 +01:00
|
|
|
import { OnAfterAppsLoaded } from './onAfterAppsLoaded';
|
2019-07-26 11:46:59 +02:00
|
|
|
import { OperatorService } from './core-services/operator.service';
|
|
|
|
import { PromptDialogComponent } from '../shared/components/prompt-dialog/prompt-dialog.component';
|
2019-02-01 13:56:08 +01:00
|
|
|
|
|
|
|
export const ServicesToLoadOnAppsLoaded: Type<OnAfterAppsLoaded>[] = [OperatorService];
|
2018-07-23 16:42:17 +02:00
|
|
|
|
2019-01-31 13:40:27 +01:00
|
|
|
/**
|
|
|
|
* Global Core Module.
|
2018-07-23 16:42:17 +02:00
|
|
|
*/
|
|
|
|
@NgModule({
|
|
|
|
imports: [CommonModule],
|
2019-07-01 11:23:33 +02:00
|
|
|
providers: [Title],
|
2019-01-10 15:06:10 +01:00
|
|
|
entryComponents: [PromptDialogComponent, ChoiceDialogComponent, ProjectionDialogComponent]
|
2018-07-23 16:42:17 +02:00
|
|
|
})
|
|
|
|
export class CoreModule {
|
|
|
|
/** make sure CoreModule is imported only by one NgModule, the AppModule */
|
2018-08-29 13:21:25 +02:00
|
|
|
public constructor(
|
2018-07-23 16:42:17 +02:00
|
|
|
@Optional()
|
|
|
|
@SkipSelf()
|
|
|
|
parentModule: CoreModule
|
|
|
|
) {
|
|
|
|
if (parentModule) {
|
|
|
|
throw new Error('CoreModule is already loaded. Import only in AppModule');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|