title: Angular Form built-in validators error object-keys
body: <p>Where can I get the the <strong>error object keys</strong> list of the <a href="https://angular.io/api/forms/Validators" rel="nofollow noreferrer">built-in Validators</a>?</p>
  
  <p>For example, if a field uses the <code>required</code> built-in validator, then I can check:</p>
  
  <p><code>form.get('myField').hasError('required')</code></p>
  
  <p>but not all the error object keys have the same name as the validator.</p>
  
  <p>For example, if I use the <code>maxLength</code> validator, then the following will <strong>not</strong> work:</p>
  
  <p><code>form.get('myField').hasError('maxLength')</code></p>