title: Min / Max Validator in Angular 2 Final
body: <p>According to <a href="http://blog.thoughtram.io/angular/2016/03/14/custom-validators-in-angular-2.html" rel="noreferrer">thoughtgram.io</a>, the currently supported validators are:</p>
  <ul>
  <li>required</li>
  <li>minlength</li>
  <li>maxlength</li>
  <li>pattern</li>
  </ul>
  <p>So, considering the following code (<a href="http://plnkr.co/edit/l3t0LmPH4aQyoc9I5nbo" rel="noreferrer">plunkr here</a>):</p>
  <pre><code>@Component({
    selector: 'my-app',
    template: `
    
    &lt;form #formRef=&quot;ngForm&quot;&gt;
      &lt;input type=&quot;number&quot; [(ngModel)]=&quot;firstValue&quot; name=&quot;firstValue&quot; min=&quot;0&quot; required/&gt;
      &lt;input type=&quot;text&quot; [(ngModel)]=&quot;secondValue&quot; maxlength=&quot;5&quot; name=&quot;secondValue&quot; required/&gt;
      &lt;button type=&quot;submit&quot;&gt; Submit &lt;/button&gt; 
    &lt;/form&gt;
    
    FORM: {{formRef.form | json }}
  `
  })
  export class AppComponent { 
    firstValue = -22;
    secondValue = &quot;eyy macarena!&quot;; 
  }
  </code></pre>
  <p>While <code>minlength</code> is supported, <code>min=&quot;0&quot;</code> is ignored by angular validation:</p>
  <p><a href="https://i.stack.imgur.com/9iV5I.png" rel="noreferrer"><img src="https://i.stack.imgur.com/9iV5I.png" alt="enter image description here" /></a></p>
  <p><a href="https://i.stack.imgur.com/usjNa.png" rel="noreferrer"><img src="https://i.stack.imgur.com/usjNa.png" alt="enter image description here" /></a></p>
  <p>So, to make the form result in an error when firstValue ngModel &lt; 0, do I need to build a custom validator?</p>