Revize 4ccb6b62
Přidáno uživatelem Pavel Fidransky před asi 5 roky(ů)
webapp/src/app/services/api/basic.service.ts | ||
---|---|---|
1 | 1 |
import {Injectable} from '@angular/core'; |
2 | 2 |
import {HttpClient, HttpErrorResponse, HttpParams} from '@angular/common/http'; |
3 | 3 |
import {throwError} from 'rxjs'; |
4 |
import {environment} from '../../../environments/environment'; |
|
5 | 4 |
import {MatSnackBar} from '@angular/material'; |
6 | 5 |
import {TranslateService} from '@ngx-translate/core'; |
6 |
import { Config } from '../util/config.service'; |
|
7 |
|
|
7 | 8 |
@Injectable({ |
8 | 9 |
providedIn: 'root' |
9 | 10 |
}) |
10 | 11 |
export class BasicService { |
11 |
protected baseUrl = environment.apiUrl;
|
|
12 |
protected baseUrl: string;
|
|
12 | 13 |
|
13 |
constructor(protected http: HttpClient, protected snackBar: MatSnackBar, protected translateService: TranslateService) { } |
|
14 |
constructor(protected config: Config, protected http: HttpClient, protected snackBar: MatSnackBar, protected translateService: TranslateService) { |
|
15 |
this.baseUrl = config.baseUrl; |
|
16 |
} |
|
14 | 17 |
|
15 | 18 |
protected handleError(error: HttpErrorResponse) { |
16 | 19 |
let errMsg; |
Také k dispozici: Unified diff
re #33: load frontend app configuration from config.json file