title: Angular 2 Forms: Unable to Access FormControl Errors
body: <p>I'm working with Form Controls, which I thought I had a good grasp on. Right now I have a function that creates the controls and assigns their respective Validators. </p>
  
  <p>For <code>this.password1:FormControl</code> and <code>this.password2:FormControl</code>, there should be an errors object like <code>errors:{required: true, pattern:true}</code>. However, the <code>pattern</code> property does not appear in the errors object for either one. I even added in <code>Validators.minLength(8)</code>to the <code>this.password2</code> FormControl to see if it worked and the minLength error property did not appear either. The flip side is 'this.email' has the right error with <code>errors: {required: true, email: true}</code>.</p>
  
  <p><strong>Note</strong>: When I test the validity of the form. It does do the pattern checks and min length checks. I just can't access the errors properties that are supposed to be created. When I console.log the errors property on the FormContril all I get is <code>errors:{required: true}</code>.</p>
  
  <p>Any help would be appreciated as to why the error properties are not created. Happy Thanksgiving!</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>  ngOnInit() {
      this.title.setTitle(this.pageTitle);
      this.createFormControls();
      this.createForm();
    }
  
    createFormControls(): void {
      const mediumRegex = new RegExp('(((?=.*[a-z])(?=.*[A-Z]))|((?=.*[a-z])(?=.*[0-9]))|((?=.*[A-Z])(?=.*[0-9])))(?=.{6,})');
  
      this.email = new FormControl('', Validators.compose([Validators.required, Validators.email]));
      this.firstName = new FormControl('', Validators.compose([Validators.required]));
      this.lastName = new FormControl('', Validators.compose([Validators.required]));
      this.password1 = new FormControl('', Validators.compose([Validators.required, Validators.pattern(mediumRegex)]));
      this.password2 = new FormControl('', Validators.compose([Validators.minLength(8), Validators.required, Validators.pattern(mediumRegex)]));
  
      console.log(this.email);
    }
  
    matchPassword(AC: AbstractControl): any {
      const password1 = AC.get('password1').value; // to get value in input tag
      const password2 = AC.get('password2').value; // to get value in input tag
      if (password1 !== password2) {
        // console.log('false');
        AC.get('password2').setErrors({'MatchPassword': true});
        // console.log(AC);
        // console.log(this.registrationForm);
      } else {
        // console.log('true');
        return null;
      }
    }
  
    createForm(): void {
  
      this.registrationForm = this.fb.group({
        email: this.email,
        firstName: this.firstName,
        lastName: this.lastName,
        password1: this.password1,
        password2: this.password2,
      }, {
        validator: this.matchPassword // your validation method
      });
    }</code></pre>
  </div>
  </div>
  </p>