title: FormBuilder group is deprecated with validator
body: <p>I have the simillar issue as here:</p>
  <p><a href="https://stackoverflow.com/questions/55519768/how-do-i-resolve-the-error-i-am-encountering-using-custom-validator-syntax">How do I resolve the error I am encountering using custom Validator syntax?</a></p>
  <p><a href="https://stackoverflow.com/questions/65155217/formbuilder-group-is-deprecated">FormBuilder group is deprecated</a></p>
  <p>I've read that Questions, but the issue still occurs in linter:</p>
  <blockquote>
  <p>group is deprecated: This API is not typesafe and can result in issues
  with Closure Compiler renaming. Use the <code>FormBuilder#group</code> overload
  with <code>AbstractControlOptions</code> instead. Note that
  <code>AbstractControlOptions</code> expects <code>validators</code> and <code>asyncValidators</code> to
  be valid validators. If you have custom validators, make sure their
  validation function parameter is <code>AbstractControl</code> and not a
  sub-class, such as <code>FormGroup</code>. These functions will be called with an
  object of type <code>AbstractControl</code> and that cannot be automatically
  downcast to a subclass, so TypeScript sees this as an error. For
  example, change the <code>(group: FormGroup) =&gt; ValidationErrors|null</code>
  signature to be <code>(group: AbstractControl) =&gt; ValidationErrors|null</code>.
  (deprecation)</p>
  </blockquote>
  <p>And here is my formBuilder:</p>
  <pre><code>registerForm = this._fb.group({
          firstname: [&quot;&quot;, [Validators.required]],
          lastname: [&quot;&quot;, [Validators.required]],
          email: [&quot;&quot;, [Validators.required, Validators.email]],
          password: [&quot;&quot;, [PasswordValidator.strength]],
          confirmPassword: [&quot;&quot;, [Validators.required]]
      }, {
          validator: PasswordValidator.confirmed(&quot;password&quot;, &quot;confirmPassword&quot;)
      });
  </code></pre>
  <p>And my validator:</p>
  <pre><code>export class PasswordValidator {
      static confirmed = (controlName: string, matchingControlName: string) =&gt; {
          return (formGroup: FormGroup) =&gt; {
              const control = formGroup.controls[controlName];
              const matchingControl = formGroup.controls[matchingControlName];
  
              if (matchingControl.errors &amp;&amp; !matchingControl.errors.confirmedValidator) {
                  return null;
              }
  
              if (control.value !== matchingControl.value) {
                  matchingControl.setErrors({ confirmedValidator: true });
                  return ({ confirmedValidator: true });
              } else {
                  matchingControl.setErrors(null);
                  return null;
              }
          };
      }
  }
  </code></pre>
  <p>Any idea why? I'm returning the proper object. :/</p>