title: Dynamic form validation in angularJS not working
body: <p>I have created dynamic form, And adding the <code>ng-required</code> attributes dynamically to my controls. but now  it's not working .</p>
  
  <p>This is my JS :</p>
  
  <pre><code>    var app = angular.module('birthdayToDo', []);
  
      app.controller('main', function($scope){ 
        $scope.Control={};
       $scope.Attributes =[
     {
       "Name":"FirstName",
       "Required":true
     },
     {
       "Name":"LastName",
       "Required":false
     },
     {
       "Name":"Email",
       "Required":true
     },
     {
       "Name":"Age",
       "Required":false
     }];
  
          $scope.submitForm = function(isValid) {
  
              // check to make sure the form is completely valid
              if (isValid) { 
                  alert('our form is amazing');
                  alert($scope.Control[1]);  // to check correct index
              }else{
                return;
              }
  
          };
      });
  </code></pre>
  
  <p>And My HTML :</p>
  
  <pre><code>&lt;html&gt;
  
  &lt;head lang="en"&gt;
  
    &lt;script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular.min.js"&gt;&lt;/script&gt;
    &lt;link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css" /&gt;
    &lt;script src="app.js"&gt;&lt;/script&gt;
  
  &lt;/head&gt;
  
  &lt;body ng-app="birthdayToDo" ng-controller="main"&gt;
    &lt;form name="userForm" ng-submit="submitForm(userForm.$valid)" novalidate&gt;
      &lt;table&gt;
        &lt;tr ng-repeat="attribute in Attributes"&gt;
          &lt;td&gt;{{attribute.Name}}&lt;/td&gt;
          &lt;td&gt;
            &lt;input type="text" name="Control[$index]" ng-model="Control[$index]" ng-required="{{attribute.Required}}" /&gt;
          &lt;/td&gt;
          &lt;td&gt;
           &lt;p ng-show="userForm.Control[$index].$error.required"&gt;{{attribute.Required == "true" &amp;&amp; attribute.Name+' Required' || ''}}&lt;/p&gt;
          &lt;/td&gt;
        &lt;/tr&gt;
      &lt;/table&gt;
      &lt;input type="submit" value="Save" /&gt;
    &lt;/form&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p><strong><a href="http://plnkr.co/edit/qTQ9kRtVQM2mSbZ8OT2D?p=preview" rel="nofollow">Plunker Link</a></strong></p>
  
  <p>I want to show error message when either the textbox value change or form is submitted . </p>
  
  <p>But when I'm doing same thing with static form it's working.
  <strong><a href="http://plnkr.co/edit/vxkfvUh5l5YiWExQQ5bk?p=preview" rel="nofollow">working plunker</a></strong></p>