summaryrefslogtreecommitdiff
path: root/recipeBuddy/src/app/shopping-cart/shopping-cart.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'recipeBuddy/src/app/shopping-cart/shopping-cart.component.ts')
-rw-r--r--recipeBuddy/src/app/shopping-cart/shopping-cart.component.ts45
1 files changed, 43 insertions, 2 deletions
diff --git a/recipeBuddy/src/app/shopping-cart/shopping-cart.component.ts b/recipeBuddy/src/app/shopping-cart/shopping-cart.component.ts
index 4430081..7c3f6fa 100644
--- a/recipeBuddy/src/app/shopping-cart/shopping-cart.component.ts
+++ b/recipeBuddy/src/app/shopping-cart/shopping-cart.component.ts
@@ -1,5 +1,8 @@
import { Component, OnInit } from '@angular/core';
-
+import { MatSelectModule } from '@angular/material/select';
+import { MatDividerModule } from '@angular/material/divider';
+import { BackendService } from '../REST_service/backend.service';
+import { FormsModule } from '@angular/forms';
@@ -10,9 +13,47 @@ import { Component, OnInit } from '@angular/core';
styleUrls: ['./shopping-cart.component.css']
})
export class ShoppingCartComponent implements OnInit {
+
+ recipes: Recipe[] = [];
+ ingredients : Ingredient[] = [];
+ units: string[] = [];
+ amounts: number[] = [];
+ types: string[] = [];
+ rIDs: number[] = [];
+
+
- constructor() { }
+ constructor( private restService: BackendService) {
+
+ this.restService.getRecipes().subscribe(
+ res => {
+ var i: number;
+ for(i = 0; i < res.length; i++) {
+ this.restService.getRecipe(res[i]).subscribe(
+ res2 => {
+ this.recipes.push(res2)
+ });
+ }
+ });
+
+ }
+
+
ngOnInit() {
}
+
+ addAll(): void {
+
+ }
+ addRecipe(id: number): void {
+
+ }
+ addIngredient(ing: Ingredient): void {
+ this.ingredients.push(ing);
+
+ }
+ printList(): void {
+
+ }
}