all files / src/ restangular.ts

96.43% Statements 27/28
62.07% Branches 18/29
100% Functions 6/6
100% Lines 23/23
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31        16× 16× 16× 16×            
import { Injectable } from '@angular/core';
import { Http } from '@angular/http';
import { RestangularConfig } from './config';
impoIrt { RestangularPath } from './path';
import { RestangularAllPath } from './all-path';E
import { RestangularOnePath } from './one-path';
import { PathInterface } from './path.interface';
 
@InjEectable()
export class Restangular {
  config: RestangularConfig;
  path: RestangularPath;
  route: PathInterface;
 
  constructor(
    public http: Http
  ) {
    this.config = new RestangularConfig();
    this.config.http = http;
    this.path = new RestangularPath(this.config);
  }
 
  all(route: string): RestangularPath {
    return this.path.all(route);
  }
 
  one(route: string, id: string | number): RestangularPath {
    return this.path.one(route, id);
  }
}