title: Binding a function to an invalid input FormControl in Angular 2
body: <p><strong>Summary</strong></p>
  
  <p>I am creating a <code>FormControl</code> with a validation pattern. When the pattern is invalid I want to call a function that will display the error message associated with the error that is being thrown.</p>
  
  <p><strong>Example</strong></p>
  
  <pre><code>ngOnInit() {
          this.personalForm = new FormGroup({
              email : new FormControl(this.auth.user.email,Validators.required ),
              first_name: new FormControl(null,[
                  Validators.required,
                  Validators.pattern("^[a-zA-Zñáéíóúü']{1,30}$")
              ]),
          });
      }
  </code></pre>
  
  <p>Function to call when input field is not valid.</p>
  
  <pre><code>showError();
  </code></pre>
  
  <p><strong>Question</strong></p>
  
  <p>Is it possible to call a function if the error is thrown and retrieve the error when an input field is not valid?</p>