title: Angular 2 retrieve error message from custom validator
body: <p>I have written a custom validator in angular 2</p>
  
  <pre><code>function validateSomething(): ValidatorFn {
    return (control: Abstractcontrol): { [key: string]: any } =&gt; {
      return {'validateSomething': 'Validation failed because'};
    }
  }
  </code></pre>
  
  <p>Pretty simple validator. Now in the html I display a dialog based on the output of the validator. What I want is to be able to display the error from the validator ('Validation failed because'). Most tutorials that I saw use hasError('validateSomething') in the html and then hard code the error, like so:</p>
  
  <pre><code>&lt;div class="ui pointing orange basic label" *ngIf="form.controls['workDate'].hasError('validateSomething')"&gt;
      Here I want to display the message from the validator 
  &lt;/div&gt;
  </code></pre>
  
  <p>Is there a way that I can get the error message from the validator?</p>