Specific Validation Errors
- To add multiple Validations, pass an array of validator function
Validator.minLength
returns a validator function
username: new FormControl('', [Validators.required, Validators.minLength(3)]),
<div *ngIf="username.touched && username.invalid">
<div *ngIf="username.errors.required">Username is required</div>
<div *ngIf="username.errors.minlength">Username should be minimum 3 chars</div>
</div>