title: Is it necessary to have a maxlength validation message on an input in Angular?
body: <p>Using the <code>maxlength</code> attribute on a form element not only wires up Angular's built-in validation, but it also prevents input beyond the specified length from being entered into the text box. Does that mean that showing an error message for breaking <code>maxlength</code> validation is pointless because the browser already enforces the limit? In my example below, it seems that the second error message never even appears.</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;input class="form-control" #fName="ngModel" required maxlength="25" /&gt;
  &lt;div class="form-error-wrapper" *ngIf="fName.invalid &amp;&amp; (fName.dirty || fName.touched)"&gt;
    &lt;div *ngIf="fName.hasError('required')" class="form-error"&gt;
      First name is required
    &lt;/div&gt;
    &lt;div *ngIf="fName.hasError('maxlength')" class="form-error"&gt;
      First name cannot be longer than 25 characters.
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>What's the point of letting the user know they're breaking a rule if the browser doesn't let them break it in the first place?</p>