title: Editing array AngularJS
body: <p>Here is my JS:</p>
  
  <pre><code>var app = angular.module('plunker', []);
    app.controller('MainCtrl', function($scope) {
      $scope.items = [
        {
        "name": "john",
        "params": {
          "age": 22,
          "weight": 66
        }
  },
     {
        "name": "eva",
        "params": {
          "age": 19,
          "weight": 54
        }
  },
     {
        "name": "jeremy",
        "params": {
          "age": 17,
          "weight": 75
        }
  }
      ]
      $scope.add = function(name, age, weight) {
  
        $scope.items.push({"name" : name, "params" : {"age" : age, "weight" : weight}});
        console.log($scope.items);
      }
    });
  </code></pre>
  
  <p>My HTML:</p>
  
  <pre><code>&lt;div ng-repeat="item in items"&gt;
        &lt;p&gt;{{item.name}}&lt;/p&gt;
        &lt;input class="form-control" name="type" placeholder="name" ng-model="name"&gt;
  
        &lt;br /&gt;
  
        &lt;ul&gt;
          &lt;li ng-repeat="(name, param) in item.params"&gt;{{name}} : {{param}}&lt;/li&gt;
          &lt;input class="form-control" placeholder="age" ng-model="age"&gt;
           &lt;input class="form-control" placeholder="weight" ng-model="weight"&gt;
          &lt;button class="btn btn-clear" type="button" ng-click="add(name, age, weight)"&gt;Update&lt;/button&gt;
        &lt;/ul&gt;
  
      &lt;/div&gt;
  </code></pre>
  
  <p>I want to edit array, and push this array in place of editing array, not add like new array.
  Here is my plunker : <a href="http://plnkr.co/edit/ewyzJWJOdNOKoSxWacNX?p=preview" rel="nofollow noreferrer">http://plnkr.co/edit/ewyzJWJOdNOKoSxWacNX?p=preview</a>
  Thanks for answers in advance!</p>