title: How to get the selected value from a dropdown list within a table in Angular Js
body: <p>In my project I have table showing a list of data. I also have a button in the table to get the details of the selected record, in this case, I only want to get the Id and the selected value from the dropdown that is in the table. So,</p>
  
  <p>I have a controller with two arrays like this this:</p>
  
  <pre><code>$scope.selectItem = "";
  $scope.ArrayOne = [{Id: 1, Name: "John Doe" },
                      {Id: 2, Name: "Jane Doe" }]
  
  $scope.ArrayTwo = [{Id: 1, Status: "Paid"},
                    {Id: 2, Status: "Unpaid"}]
  
  $scope.getDetails = function(id){
      console.log(id) // getting Id here but I also need to some get the Id of the selected item in the dropdown but I'm not too sure on how to achieve this.
  }
  </code></pre>
  
  <p>Then I'm looping the arrays in my view like this:</p>
  
  <pre><code>&lt;table&gt;
      &lt;tr ng-repeat="a in ArrayOne"&gt; 
          &lt;td&gt;{{a.Id}}&lt;/td&gt;
          &lt;td&gt;{{a.Name}}&lt;/td&gt;
          &lt;!-- looping through array two here --&gt; 
          &lt;td&gt; 
              &lt;select ng-model="selectedItem.Id" ng-options="b.Id as b.Status"&gt;&lt;/select&gt;
          &lt;td&gt;
          &lt;td&gt;&lt;button ng-click="vm.getDetails(a.Id)"&gt; getInfo &lt;/button&gt;&lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>I'm not so sure if how to achieve this, could someone help please? Or how would you go about to achieve this? 
  Thank you. </p>
  
  <p><em>EDIT:</em> One other thing i may have forgotten to mention... when i select the dropdown for the first record in the table .. it auto-fills up all the other drop downs in the table . How can i change this to only fill the dropdown for the selected record in the table?</p>