src/app/_services/location.service.ts
Methods |
constructor(httpClient: HttpClient)
|
||||||
Defined in src/app/_services/location.service.ts:10
|
||||||
Parameters :
|
getAreaNameByLocation | ||||||
getAreaNameByLocation(location: string)
|
||||||
Defined in src/app/_services/location.service.ts:17
|
||||||
Parameters :
Returns :
Observable<any>
|
getAreaNames |
getAreaNames()
|
Defined in src/app/_services/location.service.ts:13
|
Returns :
Observable<any>
|
getAreaTypeByArea | ||||||
getAreaTypeByArea(area: string)
|
||||||
Defined in src/app/_services/location.service.ts:25
|
||||||
Parameters :
Returns :
Observable<any>
|
getAreaTypes |
getAreaTypes()
|
Defined in src/app/_services/location.service.ts:21
|
Returns :
Observable<any>
|
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { environment } from '@src/environments/environment';
import { first } from 'rxjs/operators';
import { HttpClient } from '@angular/common/http';
@Injectable({
providedIn: 'root',
})
export class LocationService {
constructor(private httpClient: HttpClient) {}
getAreaNames(): Observable<any> {
return this.httpClient.get(`${environment.cicMetaUrl}/areanames`);
}
getAreaNameByLocation(location: string): Observable<any> {
return this.httpClient.get(`${environment.cicMetaUrl}/areanames/${location.toLowerCase()}`);
}
getAreaTypes(): Observable<any> {
return this.httpClient.get(`${environment.cicMetaUrl}/areatypes`).pipe(first());
}
getAreaTypeByArea(area: string): Observable<any> {
return this.httpClient
.get(`${environment.cicMetaUrl}/areatypes/${area.toLowerCase()}`)
.pipe(first());
}
}