import { NgModule, ModuleWithProviders } from '@angular/core'; import { CommonModule } from '@angular/common'; import { BROWSER_GLOBALS_PROVIDERS } from './utils/browser-globals'; import { ViewerLabComponent } from './viewer-lab/viewer-lab.component'; import { MapsApiLoaderService } from './services/map-api-loader/maps-api-loader.service'; // tslint:disable-next-line:max-line-length import { LazyMapsApiLoaderService, LAZY_MAPS_API_CONFIG, LazyMapsAPILoaderConfigLiteral } from './services/map-api-loader/lazy-maps-api-loader.service'; export function GetMapViewerComponents() { return [ ViewerLabComponent ]; } @NgModule({ imports: [ CommonModule ], declarations: GetMapViewerComponents(), exports: GetMapViewerComponents() }) export class MapViewerModule { static forRoot(LazyMapsApiLoaderConfig?: LazyMapsAPILoaderConfigLiteral): ModuleWithProviders { return { ngModule: MapViewerModule, providers: [ ...BROWSER_GLOBALS_PROVIDERS, {provide: MapsApiLoaderService, useClass: LazyMapsApiLoaderService}, {provide: LAZY_MAPS_API_CONFIG, useValue: LazyMapsApiLoaderConfig} ] }; } }