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

This commit is contained in:
2020-12-09 07:51:08 +01:00
34 changed files with 508 additions and 40 deletions
+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'));