summaryrefslogtreecommitdiff
path: root/recipeBuddy/src/app/add-recipe/add-recipe.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'recipeBuddy/src/app/add-recipe/add-recipe.component.ts')
-rw-r--r--recipeBuddy/src/app/add-recipe/add-recipe.component.ts10
1 files changed, 5 insertions, 5 deletions
diff --git a/recipeBuddy/src/app/add-recipe/add-recipe.component.ts b/recipeBuddy/src/app/add-recipe/add-recipe.component.ts
index 5109c34..3c32ae7 100644
--- a/recipeBuddy/src/app/add-recipe/add-recipe.component.ts
+++ b/recipeBuddy/src/app/add-recipe/add-recipe.component.ts
@@ -29,7 +29,7 @@ export class AddRecipeComponent {
this.fb.group({
ingrName: [''],
amount: ['', Validators.pattern('^[0-9]*(\.[0-9]*)?$')],
- units: ['']
+ unit: ['']
})
]),
steps: this.fb.array([
@@ -61,7 +61,7 @@ export class AddRecipeComponent {
this.fb.group({
ingrName: [''],
amount: ['', Validators.pattern('^[0-9]*(\.[0-9]*)?$')],
- units: ['']
+ unit: ['']
})
);
}
@@ -93,10 +93,10 @@ export class AddRecipeComponent {
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].ingrName,
+ var tmp_amount = parseFloat(formData.ingredients[i].amount)
+ ingredients.push(new Ingredient(formData.ingredients[i].ingrName,
(isNaN(tmp_amount) ? 0 : tmp_amount),
- formData.ingredients[0].unit,
+ formData.ingredients[i].unit,
""
));
}