From 33aa62ae09e1703e8be79c54934e9420ce1d112d Mon Sep 17 00:00:00 2001 From: Janis Meister Date: Wed, 26 Jan 2022 11:38:47 +0100 Subject: [PATCH] moved serives into subfolder services --- src/app/search/search.component.ts | 7 ++++--- src/app/{ => services}/nominatim.service.spec.ts | 0 src/app/{ => services}/nominatim.service.ts | 6 +++--- src/app/{ => services}/open-layers.service.spec.ts | 0 src/app/{ => services}/open-layers.service.ts | 0 src/app/{ => services}/osrm.service.spec.ts | 0 src/app/{ => services}/osrm.service.ts | 2 +- src/app/{ => services}/photon.service.spec.ts | 0 src/app/{ => services}/photon.service.ts | 2 +- 9 files changed, 9 insertions(+), 8 deletions(-) rename src/app/{ => services}/nominatim.service.spec.ts (100%) rename src/app/{ => services}/nominatim.service.ts (82%) rename src/app/{ => services}/open-layers.service.spec.ts (100%) rename src/app/{ => services}/open-layers.service.ts (100%) rename src/app/{ => services}/osrm.service.spec.ts (100%) rename src/app/{ => services}/osrm.service.ts (96%) rename src/app/{ => services}/photon.service.spec.ts (100%) rename src/app/{ => services}/photon.service.ts (89%) diff --git a/src/app/search/search.component.ts b/src/app/search/search.component.ts index d5801f4..0def0e0 100644 --- a/src/app/search/search.component.ts +++ b/src/app/search/search.component.ts @@ -1,13 +1,14 @@ import { Component, OnInit, ElementRef, ViewChild} from '@angular/core'; import { Nominatim } from '../interfaces/nominatim'; -import { NominatimService } from '../nominatim.service'; +import { NominatimService } from '../services/nominatim.service'; import { Photon, PhotonFeatureCollection } from '../interfaces/photon'; -import { PhotonService } from '../photon.service'; -import { OsrmService } from '../osrm.service'; +import { PhotonService } from '../services/photon.service'; +import { OsrmService } from '../services/osrm.service'; import { Osrm } from '../interfaces/osrm'; import { AppComponent } from '../app.component'; + @Component({ selector: 'app-search', templateUrl: './search.component.html', diff --git a/src/app/nominatim.service.spec.ts b/src/app/services/nominatim.service.spec.ts similarity index 100% rename from src/app/nominatim.service.spec.ts rename to src/app/services/nominatim.service.spec.ts diff --git a/src/app/nominatim.service.ts b/src/app/services/nominatim.service.ts similarity index 82% rename from src/app/nominatim.service.ts rename to src/app/services/nominatim.service.ts index c230c35..319b62c 100644 --- a/src/app/nominatim.service.ts +++ b/src/app/services/nominatim.service.ts @@ -1,6 +1,6 @@ import { Injectable } from '@angular/core'; import { HttpClient } from '@angular/common/http'; -import { Nominatim } from './interfaces/nominatim'; +import { Nominatim } from '../interfaces/nominatim'; import { Observable } from 'rxjs'; @Injectable({ @@ -12,7 +12,7 @@ export class NominatimService{ constructor(private http: HttpClient) { } // sends a query request to Nominatim and gets response (https://nominatim.org/release-docs/develop/api/Search/) - sendQueryRequest(q: string): Observable { + sendQueryRequest(q: string): Observable { return this.http.get("https://nominatim.openstreetmap.org/search.php?format=jsonv2&q=" + q); } -} \ No newline at end of file +} diff --git a/src/app/open-layers.service.spec.ts b/src/app/services/open-layers.service.spec.ts similarity index 100% rename from src/app/open-layers.service.spec.ts rename to src/app/services/open-layers.service.spec.ts diff --git a/src/app/open-layers.service.ts b/src/app/services/open-layers.service.ts similarity index 100% rename from src/app/open-layers.service.ts rename to src/app/services/open-layers.service.ts diff --git a/src/app/osrm.service.spec.ts b/src/app/services/osrm.service.spec.ts similarity index 100% rename from src/app/osrm.service.spec.ts rename to src/app/services/osrm.service.spec.ts diff --git a/src/app/osrm.service.ts b/src/app/services/osrm.service.ts similarity index 96% rename from src/app/osrm.service.ts rename to src/app/services/osrm.service.ts index cc7d6f2..2b58545 100644 --- a/src/app/osrm.service.ts +++ b/src/app/services/osrm.service.ts @@ -1,7 +1,7 @@ import { Injectable } from '@angular/core'; import { HttpClient } from '@angular/common/http'; import { Observable } from 'rxjs'; -import { Osrm } from './interfaces/osrm'; +import { Osrm } from '../interfaces/osrm'; @Injectable({ providedIn: 'root' diff --git a/src/app/photon.service.spec.ts b/src/app/services/photon.service.spec.ts similarity index 100% rename from src/app/photon.service.spec.ts rename to src/app/services/photon.service.spec.ts diff --git a/src/app/photon.service.ts b/src/app/services/photon.service.ts similarity index 89% rename from src/app/photon.service.ts rename to src/app/services/photon.service.ts index 6b8f366..3e0a3f5 100644 --- a/src/app/photon.service.ts +++ b/src/app/services/photon.service.ts @@ -1,6 +1,6 @@ import { Injectable } from '@angular/core'; import { HttpClient } from '@angular/common/http'; -import { PhotonFeatureCollection } from './interfaces/photon'; +import { PhotonFeatureCollection } from '../interfaces/photon'; import { Observable } from 'rxjs'; @Injectable({