UNPKG

fabric8-planner

Version:
32 lines 1.2 kB
import { Injectable } from '@angular/core'; import 'rxjs/add/operator/toPromise'; import { map } from 'rxjs/operators'; import { HttpClientService } from './../shared/http-module/http.service'; var LabelService = /** @class */ (function () { function LabelService(http) { this.http = http; } /** * getLabels - We call this service method to fetch all labels in currect space * @return Observable of LabelModel[] - Array of labels. * Url - http://localhost:8080/api/spaces/829d2039-3929-4e8e-865b-fd463b8b34f1/labels/ */ LabelService.prototype.getLabels = function (labelUrl) { return this.http.get(labelUrl) .pipe(map(function (r) { return r.data; })); }; LabelService.prototype.createLabel = function (label, url) { return this.http.post(url, { data: label }) .pipe(map(function (r) { return r.data; })); }; LabelService.decorators = [ { type: Injectable }, ]; /** @nocollapse */ LabelService.ctorParameters = function () { return [ { type: HttpClientService, }, ]; }; return LabelService; }()); export { LabelService }; //# sourceMappingURL=label.service.js.map