title: angular js specify ng-model dynamically and access that text box value back
body: <p>I need to assign a ng-model to an input dynamically and retrieve all text box the value on button click.  alert(x.WeekNumber) is not giving value</p>
  
  <p><strong>template</strong></p>
  
  <pre><code>&lt;table class="table-bordered"&gt;   
      &lt;tr ng-repeat="x in weekOneData"&gt;
          &lt;td&gt;{{x.dayDate}}&lt;/td&gt;
          &lt;td&gt;&lt;input type="number" value="0" id="x.WeekNumber" /&gt;{{x.WeekNumber}}&lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;
  
  &lt;button class="btn btn-default" ng-click="TestFunction()"&gt;testing&lt;/button&gt;
  </code></pre>
  
  <p><strong>controller</strong></p>
  
  <pre><code> $scope.weekOneData = [];
  for (var index = 1; index &lt;= 7; index++) {
      var ob = new Object();
      ob.dayDate = formattedDate;
      ob.WeekNumber = index;$scope.weekOneData[index - 1] = ob;
     }
  $scope.TestFunction = function () {
    //  sum=textbox1+textbox2+textbox3
  }
  </code></pre>