diff options
author | schencej <schencej@clarkson.edu> | 2019-12-12 12:10:28 -0500 |
---|---|---|
committer | schencej <schencej@clarkson.edu> | 2019-12-12 12:10:28 -0500 |
commit | 4b9b00024ce1b31d4c4c80e35f1298b8317378fc (patch) | |
tree | 94a26e28d15a6c7cffd7a9671035241073b5c1ee | |
parent | 7d8b3b712274613b20c299efc48e4041e3fc6d72 (diff) |
fixed stuff
-rw-r--r-- | recipeBuddy/src/app/edit-recipe/edit-recipe.component.ts | 14 | ||||
-rw-r--r-- | recipeBuddy/src/app/recipe-card/recipe-card.component.html | 2 |
2 files changed, 8 insertions, 8 deletions
diff --git a/recipeBuddy/src/app/edit-recipe/edit-recipe.component.ts b/recipeBuddy/src/app/edit-recipe/edit-recipe.component.ts index e7966b3..22ba048 100644 --- a/recipeBuddy/src/app/edit-recipe/edit-recipe.component.ts +++ b/recipeBuddy/src/app/edit-recipe/edit-recipe.component.ts @@ -81,12 +81,12 @@ export class EditRecipeComponent implements OnInit { for(i = 0; i < r.ingredients.length; i++) { this.addIngredient(); - this.ingredients.controls[0].setValue(r.ingredients[i]); + this.ingredients.controls[i].setValue(r.ingredients[i]); } for(i = 0; i < r.steps.length; i++) { this.addStep(); console.log(r.steps[i]) - this.steps.controls[0].setValue(r.steps[i]); + this.steps.controls[i].setValue(r.steps[i]); } } @@ -134,18 +134,18 @@ export class EditRecipeComponent implements OnInit { var ingredients = [] var i; for (i = 0; i < formData.ingredients.length; i++) { - var tmp_amount = parseFloat(formData.ingredients[0].amount) - ingredients.push(new Ingredient(formData.ingredients[0].name, + var tmp_amount = parseFloat(formData.ingredients[i].amount) + ingredients.push(new Ingredient(formData.ingredients[i].name, (isNaN(tmp_amount) ? 0 : tmp_amount), - formData.ingredients[0].unit, + formData.ingredients[i].unit, "" )); } var steps = [] for (i = 0; i < formData.steps.length; i++) { - var tmp_timer = parseInt(formData.steps[0].timer) - steps.push(new Step(formData.steps[0].instruction, + var tmp_timer = parseInt(formData.steps[i].timer) + steps.push(new Step(formData.steps[i].instruction, (isNaN(tmp_timer) ? 0 : tmp_timer) )); } diff --git a/recipeBuddy/src/app/recipe-card/recipe-card.component.html b/recipeBuddy/src/app/recipe-card/recipe-card.component.html index eaba29a..b6b214b 100644 --- a/recipeBuddy/src/app/recipe-card/recipe-card.component.html +++ b/recipeBuddy/src/app/recipe-card/recipe-card.component.html @@ -12,7 +12,7 @@ </mat-card-header> <mat-card-actions matSuffix> <div id="edit"> - <button mat-button (click)="edit(recipe)" routerLink="/" + <button mat-button (click)="edit(recipe)" routerLink="/edit" routerLinkActive="active"> <mat-icon>edit</mat-icon> </button> |