title: ng-model bind to element in ng-repeat Angularjs
body: <p>How bind ng-model to element inside ng-repeat?
  In fact i want to bind object in array to element and when type in input element create new input element with new ng-model. while in this example all ng-model are same. </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var myApp = angular.module('app', []);
  myApp.controller("MyCtrl",function($scope){
     $scope.items = [];
      $scope.item = {
          phone:""
      };
      $scope.items.push($scope.item);
  
      $scope.addItem = function(index){
          if($scope.items[index+1] == null)
            $scope.items.push($scope.item);
          console.log($scope.items);
      }
      
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"&gt;&lt;/script&gt;
  &lt;div ng-app="app" ng-controller="MyCtrl"&gt;
     &lt;div ng-repeat="line in items track by $index"&gt;
        &lt;!-- typing here should auto update it's preview above --&gt;
        &lt;input ng-model="line.phone" ng-keydown="addItem($index)"/&gt;
        &lt;!-- many other fields here that will also affect the preview --&gt;
      &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>