I have validated my form using reactive form validation using @rxweb package in my form and i want to show error message without multiple *ngIf I have refered a question related to it , but i could not find proper solution to my question
Here is my component.html code:
<div [formGroup]="userForm">
<div>
<input type="text" formControlName="firstname"/>
<div *ngIf="userForm.controls.firstname.errors &&
userForm.controls.firstname.errors.required"
class="alert alert-danger">
This field is Required
</div>
<div *ngIf="userForm.controls.firstname.errors && userForm.controls.firstname.errors.maxLength"
class="alert alert-danger">
max length 10
</div>
<div *ngIf="userForm.controls.firstname.errors && userForm.controls.firstname.errors.minLength"
class="alert alert-danger">
minimum length is 5
</div>
</div>
I dont want to write multiple *ngIf conditions Is there any other way to efficiently show reactive form config error messages ?