projects/maplander/shared/src/lib/directives/search-box/search-box.module.ts
Static forChild | ||||||
forChild(agmConfig: LazyMapsAPILoaderConfigLiteral)
|
||||||
Parameters :
Returns :
ModuleWithProviders
|
import {ModuleWithProviders, NgModule} from '@angular/core';
import { CommonModule } from '@angular/common';
import { SearchBoxDirective } from './search-box.directive';
import {AgmCoreModule, AgmGeocoder, LAZY_MAPS_API_CONFIG, LazyMapsAPILoaderConfigLiteral} from '@agm/core';
import {DialogModule} from '../../components/dialog/dialog.module';
@NgModule({
imports: [
CommonModule,
DialogModule,
AgmCoreModule.forRoot()
],
declarations: [
SearchBoxDirective
],
exports: [
SearchBoxDirective
]
})
export class SearchBoxModule {
static forChild(agmConfig: LazyMapsAPILoaderConfigLiteral): ModuleWithProviders {
return {
ngModule: SearchBoxModule,
providers: [
AgmGeocoder,
{
provide: LAZY_MAPS_API_CONFIG,
useValue: agmConfig
}
]
};
}
}