next-ucap-messenger/projects/ucap-webmessenger-api-common/src/lib/ucap-common-api.module.ts
2019-09-18 15:02:21 +09:00

24 lines
609 B
TypeScript

import { NgModule, ModuleWithProviders } from '@angular/core';
import { _MODULE_CONFIG } from './types/token';
import { CommonApiService } from './services/common-api.service';
import { ModuleConfig } from './types/module-config';
const SERVICES = [CommonApiService];
@NgModule({
declarations: [],
imports: [],
exports: []
})
export class UCapCommonApiModule {
public static forRoot(
config: ModuleConfig
): ModuleWithProviders<UCapCommonApiModule> {
return {
ngModule: UCapCommonApiModule,
providers: [{ provide: _MODULE_CONFIG, useValue: config }, ...SERVICES]
};
}
}