]>
Commit | Line | Data |
---|---|---|
df98563e | 1 | import { Injectable } from '@angular/core' |
d592e0a9 | 2 | import { HttpClient } from '@angular/common/http' |
92fb909c | 3 | |
154898b0 | 4 | import { ServerConfig } from '../../../../../shared' |
92fb909c C |
5 | |
6 | @Injectable() | |
7 | export class ConfigService { | |
df98563e | 8 | private static BASE_CONFIG_URL = API_URL + '/api/v1/config/' |
92fb909c | 9 | |
154898b0 | 10 | private config: ServerConfig = { |
92fb909c | 11 | signup: { |
291e8d3e | 12 | allowed: false |
92fb909c | 13 | } |
df98563e | 14 | } |
92fb909c | 15 | |
d592e0a9 | 16 | constructor (private http: HttpClient) {} |
92fb909c | 17 | |
df98563e | 18 | loadConfig () { |
d592e0a9 C |
19 | this.http.get<ServerConfig>(ConfigService.BASE_CONFIG_URL) |
20 | .subscribe(data => this.config = data) | |
92fb909c C |
21 | } |
22 | ||
df98563e C |
23 | getConfig () { |
24 | return this.config | |
92fb909c C |
25 | } |
26 | } |