### File

`src/app/core/services/product.service.ts`

### Constructor

`constructor(http: HttpService)`
Defined in src/app/core/services/product.service.ts:6
Creates an instance of ProductService. Parameters : http : `HttpService`

### Methods

getProduct
`getProduct(id: string)`
Defined in src/app/core/services/product.service.ts:24
Parameters : id Returns: `Observable<any>` *

getTaxonomies
`getTaxonomies()`
Defined in src/app/core/services/product.service.ts:36
Returns: `any` *

getProducts
`getProducts()`
Defined in src/app/core/services/product.service.ts:48
Returns: `any` *

    import { Observable } from 'rxjs/Observable';
    import { HttpService } from './http';
    import { Injectable } from '@angular/core';

    @Injectable()
    export class ProductService {

      /**
       * Creates an instance of ProductService.
       * @param {HttpService} http
       *
       * @memberof ProductService
       */
      constructor(private http: HttpService) { }

      /**
       *
       *
       * @param {string} id
       * @returns {Observable<any>}
       *
       * @memberof ProductService
       */
      getProduct(id: string): Observable<any> {
        return this.http.get(`/spree/api/v1/products/${id}`)
        .map(res => res.json());
      }

      /**
       *
       *
       * @returns {*}
       *
       * @memberof ProductService
       */
      getTaxonomies(): any {
        return this.http.get(`/spree/api/v1/taxonomies?set=nested`)
        .map(res => res.json());
      }

      /**
       *
       *
       * @returns {*}
       *
       * @memberof ProductService
       */
      getProducts(): any {
        return this.http.get(`/spree/api/v1/products`)
        .map(res => res.json());
      }
    }

# results matching ""

# No results matching ""