blob: eca4221bb2b2af06cd1e0c2b540a438889b7c8ce [file] [log] [blame]
import {AppConfig} from '../../config/app.config';
export interface IXosResourceService {
getResource(url: string): ng.resource.IResourceClass<any>;
}
export class ModelRest implements IXosResourceService {
static $inject = ['$resource'];
private resource: angular.resource.IResourceClass<any>;
/** @ngInject */
constructor(
private $resource: ng.resource.IResourceService
) {
}
public getResource(url: string): ng.resource.IResourceClass<ng.resource.IResource<any>> {
return this.resource = this.$resource(`${AppConfig.apiEndpoint}${url}/:id`, {id: '@id'});
}
}