Skip to content

Commit 04ea794

Browse files
author
AnkitSharma-007
committed
Updated the template-driven form validations
1 parent b9b89cc commit 04ea794

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/app/template-driven-form/template-driven-form.component.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ <h3>Angular Template-driven Form</h3>
2525
*ngIf="(email.touched || registerForm.submitted) && email.errors?.required">
2626
Email is required
2727
</span>
28-
<span class="text-danger"
29-
*ngIf="(email.touched || registerForm.submitted) && email.errors?.email">
28+
<span class="text-danger" *ngIf="email.touched && email.errors?.email">
3029
Enter a valid email address
3130
</span>
3231
</div>
@@ -64,7 +63,7 @@ <h3>Angular Template-driven Form</h3>
6463
Confirm Password is required
6564
</span>
6665
<span class="text-danger"
67-
*ngIf="(confirmPassword.touched || registerForm.submitted) && confirmPassword.errors?.passwordMismatch">
66+
*ngIf="confirmPassword.touched && confirmPassword.errors?.passwordMismatch">
6867
Passwords doesnot match
6968
</span>
7069
</div>

0 commit comments

Comments
 (0)