From 99287dff749f7c6fa050b597115270496738d77c Mon Sep 17 00:00:00 2001 From: Tucker Evans Date: Sun, 8 Dec 2019 15:38:08 -0500 Subject: Add basic input validation to add recipe form Validates: Name is required, Timer/Cook Time are digits, Amount/Servings are numbers (digits with optional decimal point). --- .../src/app/add-recipe/add-recipe.component.html | 38 +++++++++++++++++----- .../src/app/add-recipe/add-recipe.component.ts | 10 +++--- 2 files changed, 34 insertions(+), 14 deletions(-) (limited to 'recipeBuddy/src/app/add-recipe') diff --git a/recipeBuddy/src/app/add-recipe/add-recipe.component.html b/recipeBuddy/src/app/add-recipe/add-recipe.component.html index a8a3e5f..76095f9 100644 --- a/recipeBuddy/src/app/add-recipe/add-recipe.component.html +++ b/recipeBuddy/src/app/add-recipe/add-recipe.component.html @@ -3,19 +3,35 @@ + + Name is required + + + Name is required + - + + + Servings must be a number. + - + + + Minutes + + Must be in the form hh:mm + - Keywords/Tags + Keywords/Tags @@ -25,7 +41,7 @@

Ingredients

-
+

Ingredient {{ i + 1 }}

@@ -34,8 +50,12 @@ formControlName="ingrName"> - + + + Amount must be a number. + - Timer - + + Minutes