title: How to pass Form Group control value to a Custom Validator which uses in the same Form Group?
body: <p>I have a custom validator to check retype confirm</p>
  
  <pre><code>import { AbstractControl } from '@angular/forms';
  
  export function RetypeConfirm(confirmpassword: string) {
      return (control: AbstractControl): { [key: string]: boolean } | null =&gt; {
          if (control.value !== confirmpassword) {
               return { 'mismatch': true };
          }
          return null;
      };
  }
  </code></pre>
  
  <p>My typescript file</p>
  
  <pre><code>import { FormBuilder, Validators, FormGroup } from '@angular/forms';
  import { RetypeConfirm } from 'app/validators/retype-confirm.validator';
  
  passwordChangeForm: FormGroup;
  constructor(private fb: FormBuilder){
       this.passwordChangeForm = this.fb.group({
           newPassword: ["", [Validators.required, Validators.pattern(RegEx.STRONG_PASSWORD)]],
           confirmpassword: ["", [Validators.required, RetypeConfirm(***I want to pass passwordChangeForm.controls['newPassword'].value  here****  )]]
       });
  }
  </code></pre>
  
  <p>I need to pass <code>this.passwordChangeForm.controls['newPassword'].value</code> to RetypeConfirm custom validator</p>