BETTERZON-42: Restructuring, creating necessary components, design of Product detail component

This commit is contained in:
Paddy committed 2020-12-09 07:51:08 +01:00
commit e83b2d7511
34 files changed
+508 -40

No files matched your search

+10
View File
@@ -16,6 +16,16 @@ export class ApiService {
) {
}
getProduct(id): Observable<Product> {
try {
const prod = this.http.get<Product>((this.apiUrl + '/products/' + id));
console.log(prod);
return prod;
} catch (exception) {
process.stderr.write(`ERROR received from ${this.apiUrl}: ${exception}\n`);
}
}
getProducts(): Observable<Product[]> {
try {
const prods = this.http.get<Product[]>((this.apiUrl + '/products'));