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

25 lines
626 B
TypeScript
Raw Normal View History

2019-09-18 06:02:21 +00:00
import { NgModule, ModuleWithProviders } from '@angular/core';
import { ExternalApiService } from './services/external-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 = [ExternalApiService];
@NgModule({
declarations: [],
imports: [],
2019-11-12 09:54:21 +00:00
exports: [],
2019-09-18 06:02:21 +00:00
})
export class UCapExternalApiModule {
public static forRoot(
config: ModuleConfig
): ModuleWithProviders<UCapExternalApiModule> {
return {
ngModule: UCapExternalApiModule,
2019-11-12 09:54:21 +00:00
providers: [{ provide: _MODULE_CONFIG, useValue: config }, ...SERVICES],
2019-09-18 06:02:21 +00:00
};
}
}