blob: 92da0a50ed0d91dade231dc438e2b4b85379082f [file] [log] [blame]
Michael Landoed64b5e2017-06-09 03:19:04 +03001'use strict'
2import {IAppConfigurtaion, IApi} from "../models/app-config";
3
4interface IConfigurationUiService {
5 getConfigurationUi():ng.IPromise<any>;
6}
7
8export class ConfigurationUiService implements IConfigurationUiService {
9
10 static '$inject' = ['$http', '$q', 'sdcConfig'];
11 private api:IApi;
12
13 constructor(private $http:ng.IHttpService, private $q:ng.IQService, sdcConfig:IAppConfigurtaion) {
14 this.api = sdcConfig.api;
15 }
16
17 public getConfigurationUi = ():ng.IPromise<any> => {
18 let defer = this.$q.defer<any>();
19 this.$http.get(this.api.root + this.api.GET_configuration_ui)
20 .then((result:any) => {
21 defer.resolve(result.data);
22 });
23 return defer.promise;
24 }
25}