modify products services

This commit is contained in:
Raghu-Ch
2018-09-11 15:56:53 -04:00
parent 54b3190d09
commit 56bef2153c
2 changed files with 3 additions and 4 deletions

View File

@@ -12,8 +12,6 @@ export class ProductComponent implements OnInit {
products = [];
displayedColumns = ['productName', 'brand', 'category', 'price'];
// dataSource = new MatTableDataSource(this.productService);
// dataSource = this.products;
constructor(private productService: ProductService) { }

View File

@@ -7,11 +7,12 @@ import { Observable } from 'rxjs';
})
export class ProductService {
url = 'https://fast-ravine-56232.herokuapp.com/api/products';
private __url = 'https://fast-ravine-56232.herokuapp.com/api';
constructor(private http: HttpClient) { }
getProducts(): Observable<any> {
return this.http.get(this.url);
this.__url += '/products';
return this.http.get(this.__url);
}
}