title: ng-model - getting name and value of input box
body: <p>I have an update function and a number of input boxes. Each input has an <code>ng-blur</code> attached to it so that the update function is called whenever the cursor leaves the box.</p>
  
  <pre><code>$scope.update = function(data) {
      console.log(data); //outputs value in the textbox
      //how can I output/access the key?
  }
  </code></pre>
  
  <p>The input for <code>name</code> look like this:</p>
  
  <pre><code>&lt;input type="text" ng-model="user.name" ng-blur="update(user.name)"/&gt;
  </code></pre>
  
  <p>As I need to be able to post a JSON object in the form <code>{"name" : "bob smith"}</code> what's a good way of generating the "key" of the object bearing in mind that it will differ depending on the input box that's being used at the time?</p>