title: Retrieving the data from a ng-model
body: <p>I want to know what is the correct way to retrieve data from an <code>ng-model</code>.</p>
  
  <p>In my <code>ng-view</code>, I have this code:</p>
  
  <pre><code>    &lt;table ng-model="logs"&gt;
      &lt;tr&gt;
          &lt;td&gt;&lt;input type="text" value={{logs[whichItem].Id}} readonly /&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;&lt;input type="text" value={{logs[whichItem].FirstName}} /&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;&lt;input type="text" value={{logs[whichItem].LastName}} /&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;&lt;input type="text" value={{logs[whichItem].Mi}} /&gt;&lt;/td&gt;
      &lt;/tr&gt;
  
  &lt;/table&gt;
  &lt;div&gt;
      &lt;input type="button" value="Update" ng-click="Update()"/&gt;
      &lt;input type="button" value="Delete" ng-click="Delete()"/&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I want to retrieve those data from <code>textboxes</code>, I tried by putting a <code>ng-model</code> on each of every <code>textbox</code> but it does not work</p>
  
  <p>In my <code>controller</code>, I have this code:</p>
  
  <pre><code>logController.controller('DetailsController', ['$scope', '$http', '$routeParams', function ($scope, $http, $routeParams) {
      $scope.logs = logData;
      $scope.whichItem = $routeParams.itemId;
  
      $scope.Update = function () {
          var user = {
              Id: //what to put here
              FirstName: //what to put here
              LastName: //what to put here
              Mi: //what to put here
          };
          //Update function here
      };
  }]);
  </code></pre>
  
  <p>What should be putted in <code>Id</code>,<code>FirstName</code> and so on?</p>