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-08-05 15:00:21 +02:00
|
|
|
import { OnAfterAppsLoaded } from './definitions/on-after-apps-loaded';
|
2019-07-26 11:46:59 +02:00
|
|
|
import { OperatorService } from './core-services/operator.service';
|
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],
|
2020-04-01 12:46:06 +02:00
|
|
|
providers: [Title]
|
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');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|