title: AngularJS: change json object values with input fields (with ng-click for instance)
body: <p>"myData" in the code below is a json object which I extract from $http.get response (I call the request when my web app is initialised). User has to be able to change the data, so I created the code below with inputs that are filled with values in this object. </p>
  
  <pre><code>&lt;div ng-repeat="(parameter,value) in myData"&gt;
      &lt;p&gt;{{parameter}}&lt;/p&gt;
      &lt;!-- show only if val is defined (not 0 or null) --&gt;
      &lt;div ng-repeat="(par,val) in value" ng-show="val"&gt;
          &lt;p&gt;{{par}} : &lt;input type="text" value={{val}}&gt;&lt;/p&gt; &lt;!-- val is the value the user can change, and par is  the parameter name such as in { parameter: "value" } --&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I created the button that the user can click when he wants to save the changed data (ng-click="saveData()").</p>
  
  <p>saveData function could then use $http.put(url,data) to update the data somewhere… </p>
  
  <p>What I don't know is how to pass the whole object to the saveData() function ?
  I know you can pass everything just by adding it like saveData(myVariableOrObject), but I don't see how I would do that in my case. </p>
  
  <p>Probably I am missing something here, since I am fairly new with angularJS. Should my html inputs have some kind of ng-model there that would connect values to controller somehow? 
  I would probably figure this out, but with the whole object, hm ? Would I need to construct the object in a controller function again or is there an easier approach? </p>
  
  <p>If anyone can point me in the right direction I would be glad. </p>
  
  <p>If I was unclear please ask for more info.</p>
  
  <p>Thank you!</p>