projects/maplander/shared/src/lib/components/location/location.module.ts
Static forChild | ||||||
forChild(agmConfig: LazyMapsAPILoaderConfigLiteral)
|
||||||
Parameters :
Returns :
ModuleWithProviders
|
import {ModuleWithProviders, NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {MatButtonModule} from '@angular/material/button';
import {MatDialogModule} from '@angular/material/dialog';
import {MatFormFieldModule} from '@angular/material/form-field';
import {MatIconModule} from '@angular/material/icon';
import {MatInputModule} from '@angular/material/input';
import {MatToolbarModule} from '@angular/material/toolbar';
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
import {LocationComponent} from './location.component';
import {LocationService} from './location.service';
import {LocationDirective} from './location.directive';
import {SearchBoxModule} from '../../directives/search-box/search-box.module';
import {AgmCoreModule, LAZY_MAPS_API_CONFIG, LazyMapsAPILoaderConfigLiteral} from '@agm/core';
import {AddressModule} from '../address/address.module';
@NgModule({
imports: [
CommonModule,
FormsModule,
ReactiveFormsModule,
SearchBoxModule,
AddressModule,
MatToolbarModule,
MatButtonModule,
MatIconModule,
MatDialogModule,
MatInputModule,
MatFormFieldModule,
AgmCoreModule.forRoot()
],
declarations: [
LocationComponent,
LocationDirective
],
providers: [
LocationService
],
entryComponents: [
LocationComponent
],
exports: [
LocationComponent,
LocationDirective
]
})
export class LocationModule {
static forChild(agmConfig: LazyMapsAPILoaderConfigLiteral): ModuleWithProviders {
return {
ngModule: LocationModule,
providers: [
LocationService,
{
provide: LAZY_MAPS_API_CONFIG,
useValue: agmConfig
}
]
};
}
}