feat: implement authentication flow and dynamic API configuration #5
This commit is contained in:
19
Web/src/app/services/config.service.ts
Normal file
19
Web/src/app/services/config.service.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Observable, tap } from 'rxjs';
|
||||
|
||||
@Injectable({ providedIn: 'root' })
|
||||
export class AppConfigService {
|
||||
private config: any;
|
||||
|
||||
constructor(private readonly http: HttpClient) { }
|
||||
|
||||
loadConfig(): Observable<any> {
|
||||
return this.http.get('/config.json')
|
||||
.pipe(tap(data => this.config = data))
|
||||
}
|
||||
|
||||
get setting() {
|
||||
return this.config;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user