title: ngPattern problem with dynamic forms inside ngRepeat
body: <p>I've been stuck on a problem for a while now and I feel I've exhausted all efforts.</p>
  
  <p>I have a dynamic form created using an ng-repeat, for some reason ng-pattern will not work in this scenario, ng-required works perfect though.</p>
  
  <pre><code>field.label = "test input"
  field.key = "test_input"
  field.type = "text"
  field.templateOptions.type = "text"
  field.templateOptions.required = true
  field.templateOptions.pattern = "\\d+"
  </code></pre>
  
  <p>Here is the code:</p>
  
  <pre><code>&lt;form name="form"&gt;
     &lt;div ng-repeat="field in fields"&gt;
        &lt;div ng-if="field-type=='input'"&gt;
           &lt;label&gt;{{field.label}}&lt;/label&gt;
           &lt;input 
               type="{{field.templateOptions.type}}" 
               name="{{field.key}}"
               ng-required="{{field.templateOptions.required}}"
               ng-pattern="{{field.templateOptions.pattern}}"
               ng-model="model[field.key]"
           /&gt;
           &lt;div ng-show="form[field.key].$error.required"&gt;Required Field&lt;/div&gt;
           &lt;div ng-show="form[field.key].$dirty &amp;&amp; form[field.key].$error.pattern"&gt;Numeric Field Required&lt;/div&gt;
        &lt;/div&gt;
     &lt;/div&gt;
  </code></pre>
  
  <p></p>
  
  <p>I've even tried using a ng-form inside the ng-repeat (this didnt work).</p>
  
  <p>This works, however its not in a ng-repeat:</p>
  
  <pre><code>&lt;form name="form"&gt;
      &lt;label&gt;test input&lt;/label&gt;
      &lt;input type="text"
              name="test_input"
              ng-required="true"
              ng-pattern="\\d+"
              ng-model="model" /&gt;
      &lt;div ng-show="form.test_input.$error.required"&gt;Required Field&lt;/div&gt;
      &lt;div ng-show="form.test_input.$dirty &amp;&amp; form.test_input.$error.pattern"&gt;Numeric Field Required&lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Any help will be greatly appreciated, thanks</p>