Matteo Scandolo | f6acdbe | 2016-12-13 10:29:37 -0800 | [diff] [blame^] | 1 | import {AppConfig} from '../config/app.config'; |
2 | export class CoreRest { | ||||
3 | |||||
4 | /** @ngInject */ | ||||
5 | constructor( | ||||
6 | private $http: angular.IHttpService, | ||||
7 | private $q: angular.IQService | ||||
8 | ) { | ||||
9 | } | ||||
10 | |||||
11 | public query(): Promise<any> { | ||||
12 | const d = this.$q.defer(); | ||||
13 | this.$http.get(`${AppConfig.apiEndpoint}/core/`) | ||||
14 | .then(res => d.resolve(res.data)) | ||||
15 | .catch(d.reject); | ||||
16 | return d.promise; | ||||
17 | } | ||||
18 | } |