aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/core/config
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/core/config')
-rw-r--r--client/src/app/core/config/config.service.ts36
-rw-r--r--client/src/app/core/config/index.ts1
2 files changed, 37 insertions, 0 deletions
diff --git a/client/src/app/core/config/config.service.ts b/client/src/app/core/config/config.service.ts
new file mode 100644
index 000000000..295e68c36
--- /dev/null
+++ b/client/src/app/core/config/config.service.ts
@@ -0,0 +1,36 @@
1import { Injectable } from '@angular/core';
2import { Http } from '@angular/http';
3
4import { RestExtractor } from '../../shared/rest';
5
6@Injectable()
7export class ConfigService {
8 private static BASE_CONFIG_URL = '/api/v1/config/';
9
10 private config: {
11 signup: {
12 enabled: boolean
13 }
14 } = {
15 signup: {
16 enabled: false
17 }
18 };
19
20 constructor(
21 private http: Http,
22 private restExtractor: RestExtractor,
23 ) {}
24
25 loadConfig() {
26 this.http.get(ConfigService.BASE_CONFIG_URL)
27 .map(this.restExtractor.extractDataGet)
28 .subscribe(data => {
29 this.config = data;
30 });
31 }
32
33 getConfig() {
34 return this.config;
35 }
36}
diff --git a/client/src/app/core/config/index.ts b/client/src/app/core/config/index.ts
new file mode 100644
index 000000000..90392254a
--- /dev/null
+++ b/client/src/app/core/config/index.ts
@@ -0,0 +1 @@
export * from './config.service';