my-test123
Version:
A planner front-end for Fabric8.
44 lines • 1.65 kB
JavaScript
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { UserService } from 'ngx-login-client';
import { Spaces } from 'ngx-fabric8-wit';
import { Logger } from 'ngx-base';
import { HttpService } from './http-service';
var CollaboratorService = /** @class */ (function () {
function CollaboratorService(http, logger, spaces, userService) {
this.http = http;
this.logger = logger;
this.spaces = spaces;
this.userService = userService;
}
CollaboratorService.prototype.getCollaborators = function () {
var _this = this;
return this.spaces.current.switchMap(function (space) {
// FIXME: https://github.com/fabric8-ui/ngx-fabric8-wit/issues/82
if (space) {
return _this.http.get(space.links.self + '/collaborators?page[offset]=0&page[limit]=1000')
.map(function (resp) { return resp.json().data; });
}
else {
return Observable.of([]);
}
});
};
CollaboratorService.prototype.getCollaborators2 = function (url) {
return this.http.get(url)
.map(function (resp) { return resp.json().data; });
};
CollaboratorService.decorators = [
{ type: Injectable },
];
/** @nocollapse */
CollaboratorService.ctorParameters = function () { return [
{ type: HttpService, },
{ type: Logger, },
{ type: Spaces, },
{ type: UserService, },
]; };
return CollaboratorService;
}());
export { CollaboratorService };
//# sourceMappingURL=collaborator.service.js.map