fix: negative value is allowed in age field while adding family member of client (#1687)

now we cannot give negative input in age field

Fixes: #1686
This commit is contained in:
pc_11
2023-02-20 15:36:00 +05:30
committed by GitHub
parent f985a49f53
commit 2af7914fb5
2 changed files with 4 additions and 2 deletions
@@ -32,9 +32,9 @@
<mat-form-field fxFlex="calc(50% - 25px)">
<mat-label>Age</mat-label>
<input type="number" formControlName="age" required matInput />
<input type="number" formControlName="age" required matInput [min]="minAge" />
<mat-error *ngIf="addFamilyMemberForm.controls.age.hasError('required')">
Age is <strong>required</strong>
Age is <strong>required and cannot be negative</strong>
</mat-error>
</mat-form-field>
@@ -21,6 +21,8 @@ export class AddFamilyMemberComponent implements OnInit {
/** Maximum Due Date allowed. */
maxDate = new Date();
/** Minimum age allowed is 0. */
minAge = 0;
/** Add family member form. */
addFamilyMemberForm: FormGroup;
/** Add family member template. */