summaryrefslogtreecommitdiff
path: root/recipeBuddy/src/app/add-recipe/add-recipe.component.html
blob: 3a426879a8dbb98b87c6fcf78583e451a59489a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<form [formGroup]="recipeForm">
	<label>
		Name:
		<input type="text" formControlName="recipeName">
	</label>
	<label>
		Description:
		<input type="text" formControlName="desc">
	</label>
	<label>
		Servings:
		<input type="text" formControlName="servingSize">
	</label>
	<label>
		Cooking Time:
		<input type="text" formControlName="cookTime">
	</label>
	<label>
		Keywords/Tags:
		<input type="text" formControlName="tags">
	</label>
	<label>
		Photos (URLS):
		<input type="text" formControlName="photos">
	</label>

	<div formArrayName="ingredients">
		<h3>Ingredients</h3>
		<button (click)="addIngredient()">Add Ingredient</button>
		<div *ngFor="let address of ingredients.controls; let i=index">
			<div [formGroupName]="i">
				<h4>Ingredient {{ i + 1 }}</h4>
				<label>
					Name:
					<input type="text"
					formControlName="ingrName">
				</label>
				<label>
					Amount:
					<input type="text"
					formControlName="amount">
				</label>
				<label>
					Name:
					<input type="text"
					formControlName="units">
				</label>
			</div>
		</div>
	</div>

	<div formArrayName="steps">
		<h3>Steps</h3>
		<button (click)="addStep()">Add Step</button>
		<div *ngFor="let address of steps.controls; let i=index">
			<div [formGroupName]="i">
				<h4>Step {{ i + 1 }}</h4>
				<label>
					Instructions:
					<input type="text"
					formControlName="instruct">
				</label>
				<label>
					Timer:
					<input type="text"
					formControlName="timer">
				</label>
			</div>
		</div>
	</div>
</form>
<p>
Value: {{ recipeForm.value | json }}
</p>