blob: 51e41d3d9a8d5efa200da0a43279235f9dc37443 [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'});
}
}