title: Comparing Amount in Reactive Forms in Angular
body: <p>I need to compare the <code>amount</code> from the <code>applied_amount</code>. However they are on different controls but they are on the same formgroup. How should i check if the "amount" is greater than the "applied_amount"? Here's the code below.</p>
  
  <pre><code> this.reportForm = this.fb.group({
                  employee_id: [null, Validators.required],
                  outlet_id: [null, Validators.required],
                  grand_total: new FormControl({value: null, disabled: true}, Validators.required),
                  rows: this.fb.array([]),
                  applied_amount: [null, Validators.required],
              });
  
  
  initGroup() {
          let rows = this.reportForm.get('rows') as FormArray;
          rows.push(this.fb.group({
              expense_account: ['', Validators.required],
              description: ['', Validators.required],
              amount: ['', Validators.required],
          },{validator: this.customValidator(rows)}))
      }
  
  
  
  customValidator(group: any) {
          if ((group.controls.amount.value &gt; group.parent.parent.controls.applied_amount.value)) {
              return { out1: true }
          }
          return null;
      }
  </code></pre>