I need to validate the two fields such that the minimum value should be less than the maximum value. As the user types a value in the minimum score and if it is greater than the maximum score, error must be thrown.
<label class="col-2 col-form-label text-right font-weight-bold">Maximum Score*</label>
<div class="col-2">
<input #firstScore="ngModel" [(ngModel)]="exams.firstScore" (keypress)="numberOnly($event)" name="firstScore" type="text">
</div>
<label class="col-3 col-form-label text-right font-weight-bold">Minimum Score*</label>
<div class="col-2">
<input #secondScore="ngModel" [(ngModel)]="exams.secondScore" class="form-control" (keypress)="numberOnly($event)" name="secondScore" type="text"></div>
</div>