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

29 lines
840 B
TypeScript
Raw Normal View History

import { CommonModule } from '@angular/common';
import { NgModule, Optional, SkipSelf, Type } from '@angular/core';
import { Title } from '@angular/platform-browser';
2019-08-05 15:00:21 +02:00
import { OnAfterAppsLoaded } from './definitions/on-after-apps-loaded';
import { OperatorService } from './core-services/operator.service';
export const ServicesToLoadOnAppsLoaded: Type<OnAfterAppsLoaded>[] = [OperatorService];
/**
* Global Core Module.
*/
@NgModule({
imports: [CommonModule],
providers: [Title]
})
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');
}
}
}