Q:

Angular reactive form validate input based on two other input

I have three input fields, namely

Minimum score
Maximum score
Origin at

So, origin at value must be between minimum score and maximum score.
My form looks like this
this.fb.group({
    min: ['', [Validators.required]],
    max: ['', [Validators.required]],
    origin: ['', [Validators.required, Validators.min(?), Validators.max(?)]] # I need value of min and max input field value here
})

How do I validate origin input field properly?
EDIT:
NOTE - fb is FormBuilder
My entire form
this.scalesForm = this.fb.group({
  scales: this.fb.array([
    this.fb.group({
      type: ['x', [Validators.required]],
      name: ['', [Validators.required]],
      components: this.fb.array([], [Validators.required]),
      min: ['', [Validators.required]],
      max: ['', [Validators.required]],
      origin: ['', [Validators.required]]
    }),
    this.fb.group({
      type: ['y', [Validators.required]],
      name: ['', [Validators.required]],
      components: this.fb.array([], [Validators.required]),
      min: ['', [Validators.required]],
      max: ['', [Validators.required]],
      origin: ['', [Validators.required]]
    })
  ])
});

A:

I'll use a custom validator, in your case something like:
export function ValidateOrigin(control: AbstractControl): {[key: string]: boolean} | null {
  if (control.value < this.scalesForm.controls.scales[0].controls.min.value && control.value > this.scalesForm.controls.scales[0].controls.max.value) {
    return { invalidOrigin: true };
  } else {
    return null;
  }
}

// in the form declaration
this.fb.group({
  min: ['', [Validators.required]],
  max: ['', [Validators.required]],
  origin: ['', [Validators.required, ValidateOrigin]]
})

