diff options
author | Tucker Evans <tuckerevans24@gmail.com> | 2019-12-07 13:32:21 -0500 |
---|---|---|
committer | Tucker Evans <tuckerevans24@gmail.com> | 2019-12-08 15:03:07 -0500 |
commit | 4efaeb517b94690483a14f25a224de73c0f1b055 (patch) | |
tree | 8e4224e547633c050dad317d56c2e6426b8c0069 /recipeBuddy/src/app/add-recipe/add-recipe.component.html | |
parent | 75a82f8a40b9f296aa71a4b6cef0fa8ea8a1c591 (diff) |
Add add recipe form requires a recipe name before submitting
Diffstat (limited to 'recipeBuddy/src/app/add-recipe/add-recipe.component.html')
-rw-r--r-- | recipeBuddy/src/app/add-recipe/add-recipe.component.html | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/recipeBuddy/src/app/add-recipe/add-recipe.component.html b/recipeBuddy/src/app/add-recipe/add-recipe.component.html index 36d45b6..a8a3e5f 100644 --- a/recipeBuddy/src/app/add-recipe/add-recipe.component.html +++ b/recipeBuddy/src/app/add-recipe/add-recipe.component.html @@ -1,7 +1,8 @@ <form [formGroup]="recipeForm" class="form" (ngSubmit)="onSubmit()"> <h2>Add Recipe</h2> <mat-form-field class="full-width"> - <input matInput placeholder="Name" type="text" formControlName="recipeName"> + <input matInput placeholder="Name" type="text" + formControlName="recipeName" required> </mat-form-field> <mat-form-field class="full-width"> <textarea matInput placeholder="Description" @@ -83,5 +84,6 @@ </button> </div> </div> - <button mat-flat-button color="primary" type="submit">Submit</button> + <button mat-flat-button color="primary" type="submit" + [disabled]="!recipeForm.valid">Submit</button> </form> |