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

25 lines
614 B
TypeScript
Raw Normal View History

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