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

24 lines
621 B
TypeScript

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