mirror of
https://github.com/Raghu-Ch/InventoryApp.git
synced 2026-02-10 04:43:02 -05:00
modify products services
This commit is contained in:
@@ -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) { }
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user