mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-09-22 05:50:48 +02:00
40 lines
919 B
TypeScript
40 lines
919 B
TypeScript
/**
|
|
* @license
|
|
* Copyright Akveo. All Rights Reserved.
|
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
*/
|
|
|
|
import { ModuleWithProviders, NgModule, Optional, SkipSelf } from '@angular/core';
|
|
import { CommonModule } from '@angular/common';
|
|
|
|
import { throwIfAlreadyLoaded } from './module-import-guard';
|
|
import { DataModule } from './data/data.module';
|
|
|
|
const PIPES = [
|
|
];
|
|
|
|
const NB_CORE_PROVIDERS = [
|
|
...DataModule.forRoot().providers,
|
|
];
|
|
|
|
@NgModule({
|
|
imports: [
|
|
CommonModule,
|
|
],
|
|
exports: [...PIPES],
|
|
declarations: [...PIPES],
|
|
})
|
|
export class CoreModule {
|
|
constructor(@Optional() @SkipSelf() parentModule: CoreModule) {
|
|
throwIfAlreadyLoaded(parentModule, 'CoreModule');
|
|
}
|
|
|
|
static forRoot(): ModuleWithProviders {
|
|
return <ModuleWithProviders>{
|
|
ngModule: CoreModule,
|
|
providers: [
|
|
...NB_CORE_PROVIDERS,
|
|
],
|
|
};
|
|
}
|
|
}
|