### File

`src/app/_services/location.service.ts`

### Index

###### Methods
getAreaNameByLocation getAreaNames getAreaTypeByArea getAreaTypes

### Constructor

`constructor(httpClient: HttpClient)`
Defined in src/app/_services/location.service.ts:10
Parameters :
Name | Type | Optional
httpClient | `HttpClient` | No

### Methods

getAreaNameByLocation
`getAreaNameByLocation(location: string)`
Defined in src/app/_services/location.service.ts:17
Parameters :
Name | Type | Optional
location | `string` | No
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 :
Name | Type | Optional
area | `string` | No
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());
      }
    }

# result-matching ""

# No results matching ""