refactoring

This commit is contained in:
marcusferl@weifer.de 2022-09-23 07:36:54 +02:00
parent bce75e76fe
commit 6cc10768d3
3 changed files with 11 additions and 12 deletions

1
.gitignore vendored
View File

@ -41,3 +41,4 @@ testem.log
.DS_Store .DS_Store
Thumbs.db Thumbs.db
src/environments/environment.ts src/environments/environment.ts
src/environments/environment.ts

View File

@ -8,18 +8,15 @@ import { environment } from 'src/environments/environment';
providedIn: 'root' providedIn: 'root'
}) })
export class WeatherApiService { export class WeatherApiService {
url:string = environment.weatherApiBaseUrl; url: string = environment.weatherApiBaseUrl;
temp:any
constructor(private http: HttpClient) { }
constructor(private http:HttpClient) {} getData(): Observable<WeatherData> {
getData():Observable<WeatherData>{
return this.http.get<WeatherData>(this.url) return this.http.get<WeatherData>(this.url)
} }
getDayPart(): Observable<Daypart>{ getDayPart(): Observable<Daypart> {
return this.http.get<Daypart>(this.url) return this.http.get<Daypart>(this.url)
} }
} }

View File

@ -3,7 +3,8 @@
// The list of file replacements can be found in `angular.json`. // The list of file replacements can be found in `angular.json`.
export const environment = { 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"
}; };
/* /*