From 6cc10768d3271b094b8e930f540336ee994f6ba5 Mon Sep 17 00:00:00 2001 From: "marcusferl@weifer.de" Date: Fri, 23 Sep 2022 07:36:54 +0200 Subject: [PATCH] refactoring --- .gitignore | 1 + src/app/weather-api.service.ts | 19 ++++++++----------- src/environments/environment.ts | 3 ++- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index 0162b46..e88801b 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,4 @@ testem.log .DS_Store Thumbs.db src/environments/environment.ts +src/environments/environment.ts diff --git a/src/app/weather-api.service.ts b/src/app/weather-api.service.ts index b22a84e..5bdb672 100644 --- a/src/app/weather-api.service.ts +++ b/src/app/weather-api.service.ts @@ -8,18 +8,15 @@ import { environment } from 'src/environments/environment'; providedIn: 'root' }) export class WeatherApiService { -url:string = environment.weatherApiBaseUrl; -temp:any + url: string = environment.weatherApiBaseUrl; + constructor(private http: HttpClient) { } -constructor(private http:HttpClient) {} - - -getData():Observable{ - return this.http.get(this.url) -} -getDayPart(): Observable{ - return this.http.get(this.url) -} + getData(): Observable { + return this.http.get(this.url) + } + getDayPart(): Observable { + return this.http.get(this.url) + } } \ No newline at end of file diff --git a/src/environments/environment.ts b/src/environments/environment.ts index f56ff47..b0777b4 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -3,7 +3,8 @@ // The list of file replacements can be found in `angular.json`. export const environment = { - production: false + production: false, + weatherApiBaseUrl: "https://api.weather.com/v3/wx/forecast/daily/5day?geocode=49.9667,7.9046&format=json&units=m&language=de-DE&apiKey=bd2007c3853d41bba007c3853d21bbb1" }; /*