42 lines
1.1 KiB
TypeScript
42 lines
1.1 KiB
TypeScript
import { NgModule, ModuleWithProviders } from '@angular/core';
|
|
import { CommonModule } from '@angular/common';
|
|
|
|
import { UiModule } from '@ucap/ng-ui';
|
|
|
|
import { ModuleConfig } from './config/module-config';
|
|
import { _MODULE_CONFIG } from './config/token';
|
|
|
|
import { TranslatePipe } from './pipes/translate.pipe';
|
|
|
|
import { TranslateService } from './services/translate.service';
|
|
|
|
const COMPONENTS = [];
|
|
const DIALOGS = [];
|
|
const PIPES = [TranslatePipe];
|
|
const DIRECTIVES = [];
|
|
const SERVICES = [TranslateService];
|
|
|
|
@NgModule({
|
|
declarations: [],
|
|
imports: [],
|
|
exports: []
|
|
})
|
|
export class OrganizationUiRootModule {}
|
|
|
|
@NgModule({
|
|
imports: [CommonModule, UiModule],
|
|
exports: [...COMPONENTS, ...DIRECTIVES, ...PIPES],
|
|
declarations: [...COMPONENTS, ...DIRECTIVES, ...PIPES],
|
|
entryComponents: [...DIALOGS]
|
|
})
|
|
export class OrganizationUiModule {
|
|
public static forRoot(
|
|
config: ModuleConfig
|
|
): ModuleWithProviders<OrganizationUiRootModule> {
|
|
return {
|
|
ngModule: OrganizationUiRootModule,
|
|
providers: [{ provide: _MODULE_CONFIG, useValue: config }, ...SERVICES]
|
|
};
|
|
}
|
|
}
|