blob: 908ca0f5c1de947632f81a4e82e744d94cc90ece [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`);
}
}