title: Adding Object in JSON dictionary in AngularJS
body: <p>How can I add a new object which be read from input form in AngularJS ? </p>
  
  <p>my JSON :</p>
  
  <pre><code>{
  "1": {
      "name": "Audi",
      "year": "1993",
  
  },
  "2": {
      "name": "BMW",
      "year": "2012",
  }
  }
  </code></pre>
  
  <p><br/>
  my Add.html:</p>
  
  <pre><code>&lt;form name="addForm" ng-controller="AddCtrl" ng-submit="AddCtrl.newcar.(car)"&gt;
      &lt;p&gt;name: &lt;input type="text" ng-model="AddCtrl.newcar.name"&gt;&lt;/p&gt;
      &lt;p&gt;year: &lt;input type="text" ng-model="AddCtrl.newcar.year"&gt;&lt;/p&gt;
      &lt;input type="submit" value="send" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p><br/>
  my AddCtrl :</p>
  
  <pre><code>angular.module('motoApp')
  .controller('AddCtrl', ['$scope','$http', '$routeParams', function($scope, $http,
          $routeParams) {    
      $http.get('scripts/controllers/cars.json').success (function(data){
  
      });
  
      this.newcar = {};
  
      this.addCar = function(car) {
          car.name.push(this.name);
          this.newcar ={};
      };
  
    }]
  );
  </code></pre>
  
  <p>I want to have page that after filling all inputs and cliking submit button new car will be added in JSON with next id. Where and what should I add to have achieve this ?</p>