import { Injectable, Inject } from "ng-forward"; import {RestangularService} from "./restangular_service"; import {ProfileService} from "./profile.service"; @Injectable() @Inject("Restangular", "$q", "$log", ProfileService) export class PersonService extends RestangularService { constructor(Restangular: restangular.IService, $q: ng.IQService, $log: ng.ILogService, protected profileService: ProfileService) { super(Restangular, $q, $log); } getResourcePath() { return "people"; } getDataKeys() { return { singular: 'person', plural: 'people' }; } getTags(profile: noosfero.Profile): ng.IPromise> { let p = this.getElement(profile.id).customGET('tags'); let deferred = this.$q.defer>(); p.then(this.getHandleSuccessFunction>(deferred)); p.catch(this.getHandleErrorFunction>(deferred)); return deferred.promise; } }