title: How to store form data using angularjs?
body: <p>I've created a form with input fields which displays current values of a json file. Now i want when the user changes the values and submits the form i should be able to retrieve the new values and later write it to a json file. 
  my present code is as follows</p>
  
  <p>html file</p>
  
  <pre><code>&lt;html ng-app&gt;
  &lt;head&gt;
    &lt;script src="angular.min.js"&gt;&lt;/script&gt;
    &lt;script src="angularjs.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body ng-controller="teamsController"&gt;
    &lt;form &gt;
      &lt;table&gt;
          &lt;thead&gt;
              &lt;th&gt;TeamName&lt;/th&gt;&lt;th&gt;Wins&lt;/th&gt;
          &lt;/thead&gt;
      &lt;tr ng-repeat="team in teams"&gt;&lt;td&gt;&lt;input type="text" value="{{team.teamName}}"&gt;&lt;/td&gt;
      &lt;td&gt;&lt;input type="text" value="{{team.w}}"&gt;&lt;/td&gt;&lt;/tr&gt;
      &lt;/table&gt;
      &lt;input type="submit" value="Save new values" ng-click="savedata()"&gt;
    &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>js file</p>
  
  <pre><code>var teamsController = function ($scope,$http) {
  $http.get("teams.json").success(function(data)
  {
  $scope.teams=data.teams;
  console.log(data);
  console.log($scope.teams);
  });
  }
  </code></pre>
  
  <p>and the json file is</p>
  
  <pre><code>{"leagueName":"American League", "abbr":"AL", "teams":[
      {"teamName":"Tampa Bay", "w":96, "l":66},
      {"teamName":"NY Yankees", "w":95, "l":67},
      {"teamName":"Boston", "w":89, "l":73},
      {"teamName":"Toronto", "w":85, "l":77},
      {"teamName":"Baltimore", "w":66, "l":96},
      {"teamName":"Minnesota", "w":94, "l":68},
      {"teamName":"Chicago White Sox", "w":88, "l":74},
      {"teamName":"Detroit", "w":81, "l":81},
      {"teamName":"Cleveland", "w":69, "l":93},
      {"teamName":"Kansas City", "w":67, "l":95},
      {"teamName":"Texas", "w":90, "l":72},
      {"teamName":"Oakland", "w":91, "l":81},
      {"teamName":"LA Angels", "w":80, "l":82},
      {"teamName":"Seattle", "w":61, "l":101}]}
  </code></pre>
  
  <p>Thanks alot in advance!</p>