diff options
author | schencej <schencej@clarkson.edu> | 2019-12-12 10:41:08 -0500 |
---|---|---|
committer | schencej <schencej@clarkson.edu> | 2019-12-12 10:41:08 -0500 |
commit | 946512c32a3b94079c9d2aaf48ef16d09fd14e3d (patch) | |
tree | 39869562d6defa06096dfdb31148ab45948fd3af /recipeBuddy/src/app/shopping-cart/shopping-cart.component.ts | |
parent | 2685a5d6838cf5572998d57eb391f86f4f797199 (diff) | |
parent | 09aea62746e50d8284dc234692e7641cca03cc42 (diff) |
merged with master
Diffstat (limited to 'recipeBuddy/src/app/shopping-cart/shopping-cart.component.ts')
-rw-r--r-- | recipeBuddy/src/app/shopping-cart/shopping-cart.component.ts | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/recipeBuddy/src/app/shopping-cart/shopping-cart.component.ts b/recipeBuddy/src/app/shopping-cart/shopping-cart.component.ts new file mode 100644 index 0000000..26808ee --- /dev/null +++ b/recipeBuddy/src/app/shopping-cart/shopping-cart.component.ts @@ -0,0 +1,62 @@ +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'; +import { Recipe } from '../DataModels/recipe'; +import { Ingredient } from '../DataModels/ingredient'; + + + + + +@Component({ + selector: 'shopping-cart.component', + templateUrl: './shopping-cart.component.html', + styleUrls: ['./shopping-cart.component.css'] +}) +export class ShoppingCartComponent implements OnInit { + + recipes: Recipe[] = []; + ingredients : Ingredient[] = []; + units: string[] = []; + amounts: number[] = []; + types: string[] = []; + rIDs: number[] = []; + + + + 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 { + + } +} |