title: Dynamically add input filed into array
body: <p>I want to add input field dynamically and ng-model must be in the below structure. I also want to delete items from array.</p>
  
  <p><strong>Expected Json</strong></p>
  
  <pre><code>   {
         "Animals": {
              "animal": [ "dog","cat","lion"  ]
          }
     }
  </code></pre>
  
  <p><strong>View</strong></p>
  
  <pre><code>  &lt;div ng-repeat="x in selected.Animals.animal"&gt;
       &lt;button ng-hide="$first" ng-click="removeChoice($index)"&gt;remove&lt;/button&gt;
       &lt;input type="text" ng-model="x"/&gt;
       &lt;button ng-show="$last" ng-click="addNewChoice(x)"&gt;addnew&lt;/button&gt;
   &lt;/div&gt;
  </code></pre>
  
  <p><strong>Controller</strong></p>
  
  <pre><code>$scope.selected={};
  $scope.selected.Animals= {};
  $scope.selected.Animals.animal=[""];
  
  $scope.addNewChoice = function (x) {
      $scope.selected.Animals.animal.push(x);
  };
  
  $scope.removeChoice = function (index) {
      $scope.selected.Animals.animal.splice(index, 1);
  };
  </code></pre>
  
  <p>Here is the <a href="http://jsbin.com/mufisiqeru/edit?html,js,console,output" rel="nofollow">workarea</a></p>