Skip to content

Commit ba7999a

Browse files
committed
Display required error message
1 parent 37b6d9f commit ba7999a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ <h2>Bootcamp Enrollment Form</h2>
66
<div class="form-group">
77
<label>Name</label>
88
<input type="text" #name="ngModel" required class="form-control" [class.is-invalid]="name.invalid && name.touched" name="name" [(ngModel)]="userModel.name">
9+
<div class="invalid-feedback" [class.d-none]="name.valid || name.untouched">Name is required</div>
910
</div>
1011

1112
<div class="form-group">

0 commit comments

Comments
 (0)