summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/services/configuration-ui-service.ts
blob: 92da0a50ed0d91dade231dc438e2b4b85379082f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
'use strict'
import {IAppConfigurtaion, IApi} from "../models/app-config";

interface IConfigurationUiService {
    getConfigurationUi():ng.IPromise<any>;
}

export class ConfigurationUiService implements IConfigurationUiService {

    static '$inject' = ['$http', '$q', 'sdcConfig'];
    private api:IApi;

    constructor(private $http:ng.IHttpService, private $q:ng.IQService, sdcConfig:IAppConfigurtaion) {
        this.api = sdcConfig.api;
    }

    public getConfigurationUi = ():ng.IPromise<any> => {
        let defer = this.$q.defer<any>();
        this.$http.get(this.api.root + this.api.GET_configuration_ui)
            .then((result:any) => {
                defer.resolve(result.data);
            });
        return defer.promise;
    }
}