<input type=”text” ngModel
name=”firstName”
required
minlength=”4″>
<span *ngIf=””>Invalid field data</span>
- You can make use of a template reference variable and the exportAs feature that the ngModel directive has.
- You can use the ngModel directive in combination with the input field name.
- You can use a template reference variable for the HTML input element and then check the valid property off of that.
- It is not possible to get access to the field value with template-driven forms. You must use reactive forms for that.