next-ucap-messenger/projects/ucap-webmessenger-api-common/src/lib/ucap-common-api.module.ts

24 lines
609 B
TypeScript
Raw Normal View History

2019-09-18 06:02:21 +00:00
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]
};
}
}