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:
+2
-2
@@ -32,9 +32,9 @@
|
|||||||
|
|
||||||
<mat-form-field fxFlex="calc(50% - 25px)">
|
<mat-form-field fxFlex="calc(50% - 25px)">
|
||||||
<mat-label>Age</mat-label>
|
<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')">
|
<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-error>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
|
|||||||
+2
@@ -21,6 +21,8 @@ export class AddFamilyMemberComponent implements OnInit {
|
|||||||
|
|
||||||
/** Maximum Due Date allowed. */
|
/** Maximum Due Date allowed. */
|
||||||
maxDate = new Date();
|
maxDate = new Date();
|
||||||
|
/** Minimum age allowed is 0. */
|
||||||
|
minAge = 0;
|
||||||
/** Add family member form. */
|
/** Add family member form. */
|
||||||
addFamilyMemberForm: FormGroup;
|
addFamilyMemberForm: FormGroup;
|
||||||
/** Add family member template. */
|
/** Add family member template. */
|
||||||
|
|||||||
Reference in New Issue
Block a user