title: Angular 2 custom validator with parameters
body: <p>How do I create let's say my own maxLength validator in Angular 2?
  All examples I could find use validators similar to 'required' one meaning that they already know the rules. They only accept one param - the control itself. How do I pass more parameters?</p>
  
  <p>Here's the sample validator I have. How do I modify it to pass number 5 as a parameter?</p>
  
  <pre><code>export class MyValidators {
      static minValue(control:Control): {[s: string]: boolean} {
          var num = +control.value;
          if (isNaN(num) || num &lt; 5 ) { return {"minValue": true}; }
          return null;
      }
  }
  </code></pre>