diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-09-14 11:57:49 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-09-14 11:57:49 +0200 |
commit | d592e0a9b2931c7c9cbedb27fb8efc9aaacad9bb (patch) | |
tree | 549b14b842de296efed846a11b3681efe08cfa9e /client/src/app/core/config/config.service.ts | |
parent | 91f6f169b1110eeae6ebf5c387f4204b0d07703c (diff) | |
download | PeerTube-d592e0a9b2931c7c9cbedb27fb8efc9aaacad9bb.tar.gz PeerTube-d592e0a9b2931c7c9cbedb27fb8efc9aaacad9bb.tar.zst PeerTube-d592e0a9b2931c7c9cbedb27fb8efc9aaacad9bb.zip |
Move to HttpClient and PrimeNG data table
Diffstat (limited to 'client/src/app/core/config/config.service.ts')
-rw-r--r-- | client/src/app/core/config/config.service.ts | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/client/src/app/core/config/config.service.ts b/client/src/app/core/config/config.service.ts index acdc12cc6..3c479bcb8 100644 --- a/client/src/app/core/config/config.service.ts +++ b/client/src/app/core/config/config.service.ts | |||
@@ -1,7 +1,6 @@ | |||
1 | import { Injectable } from '@angular/core' | 1 | import { Injectable } from '@angular/core' |
2 | import { Http } from '@angular/http' | 2 | import { HttpClient } from '@angular/common/http' |
3 | 3 | ||
4 | import { RestExtractor } from '../../shared/rest' | ||
5 | import { ServerConfig } from '../../../../../shared' | 4 | import { ServerConfig } from '../../../../../shared' |
6 | 5 | ||
7 | @Injectable() | 6 | @Injectable() |
@@ -14,17 +13,11 @@ export class ConfigService { | |||
14 | } | 13 | } |
15 | } | 14 | } |
16 | 15 | ||
17 | constructor ( | 16 | constructor (private http: HttpClient) {} |
18 | private http: Http, | ||
19 | private restExtractor: RestExtractor | ||
20 | ) {} | ||
21 | 17 | ||
22 | loadConfig () { | 18 | loadConfig () { |
23 | this.http.get(ConfigService.BASE_CONFIG_URL) | 19 | this.http.get<ServerConfig>(ConfigService.BASE_CONFIG_URL) |
24 | .map(this.restExtractor.extractDataGet) | 20 | .subscribe(data => this.config = data) |
25 | .subscribe(data => { | ||
26 | this.config = data | ||
27 | }) | ||
28 | } | 21 | } |
29 | 22 | ||
30 | getConfig () { | 23 | getConfig () { |