FarmMapsLib/projects/common/src/fm/services/geolocator.service.ts
Willem Dantuma 1daa8e257f
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
make Observable
2021-08-04 16:12:22 +02:00

22 lines
619 B
TypeScript

import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { IUser } from '../models/user';
import { HttpClient,HttpHeaders } from "@angular/common/http";
import { AppConfig } from "../shared/app.config";
@Injectable({
providedIn: 'root',
})
export class GeolocatorService {
constructor(public httpClient: HttpClient, public appConfig: AppConfig) {
}
ApiEndpoint() {
return this.appConfig.getConfig("apiEndPoint");
}
geocode(address:string): Observable<any> {
return this.httpClient.get<any>(`${this.ApiEndpoint()}/api/v1/service/geocode?address=${address}`)
}
}