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

25 lines
571 B
TypeScript
Raw Normal View History

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