title: angular forms 'confirm password' showing error
body: <p>I am using angular forms to create a register form. 
  I have made a custom validator which checked if the password is the same as confirm password field. Although the error of 'password do not match' does not show, the input is still red until all the fields are entered. </p>
  
  <p>The form builder with the custom validator method <code>checkPasswords</code></p>
  
  <pre class="lang-js prettyprint-override"><code>this.registerForm = this.formBuilder.group({
    firstName: ['', Validators.required],
    lastName: ['', Validators.required],
    email: ['', [Validators.required, Validators.email]],
    password: ['', [Validators.required]],
    confirmPassword: ['', [Validators.required]]
    },
    { validator: this.checkPasswords });
  
  
  checkPasswords(group: FormGroup) {
    // here we have the 'passwords' group
    let pass = group.get('password').value;
    let confirmPassword = group.get('confirmPassword').value;
    return pass === confirmPassword ? null : { notSame: true };
  }
  </code></pre>
  
  <p>and the html below</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;mat-form-field required&gt;
      &lt;input matInput type="password" placeholder="Password" formControlName="password"&gt;
      &lt;mat-error&gt;Password is not valid&lt;/mat-error&gt;
  &lt;/mat-form-field&gt;
  
  &lt;mat-form-field required&gt;
      &lt;input matInput type="password" placeholder="Confirm password"
             formControlName="confirmPassword"
             [errorStateMatcher]="matcher"&gt;
      &lt;mat-error *ngIf="registerForm.hasError('notSame')"&gt;Passwords do not match&lt;/mat-error&gt;
  &lt;/mat-form-field&gt;
  </code></pre>
  
  <p>I have tried to do some debugging, and I think it is because the form group status is 'invalid' until all fields are entered, but the form group control for <code>confirmPassword</code> is showing valid. 
  How can I get status for confirmPassword to use the status of its control? </p>
  
  <p>Thanks</p>