title: Dynamic pattern validation in Angular 2 and 4
body: <p>Input validation works fine with a fixed pattern, e.g.</p>
  
  <pre><code>&lt;input type="number"
      [(ngModel)]="info.sortOrder"
      pattern="[0-9][0-9]"
      id="sortOrder" name="sortOrder" #sortOrder="ngModel"/&gt;
  </code></pre>
  
  <p>When changing the pattern to be evaluated through a function, validation always fails. The function "customPattern()" is called, though.</p>
  
  <pre><code>&lt;input type="number"
      [(ngModel)]="info.sortOrder"
      [pattern]="customPattern()"
      id="sortOrder" name="sortOrder" #sortOrder="ngModel"/&gt;
  </code></pre>
  
  <p>With</p>
  
  <pre><code>customPattern() { return "[1-9][0-9]"; }
  </code></pre>
  
  <p>Is this a bug or is this not supposed to work this way?</p>