title: How to select dropdownlist values of particular text value which is in ng-repeat and ng-model in angularjs and how can we post it to database
body: <p>I'm pretty new to angularjs.So,please kindly ignore if there are any errors.Here I have one dropdownlist within ng-repeat if I select the values in dropdownlist the corresponding Item code and the selected description from dropdownlist should pass to angularcontroller and I need to post it to the mvc controller
  <div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>angular.module('myApp', [])
    .controller('ctrl', ['$scope', '$http', '$rootScope',function ($scope, $http,$rootScope) {
      $scope.values = [{
  
          Code: 1,
  
          Description: 'Apple'
         
  
      }, {
  
          Code: 2,
  
           Description: 'Orange'
  
      }, {
  
          Code: 3,
  
           Description: 'Mango'
  
      }, {
  
          COde: 4,
  
           Description: 'Guva'
  
      }
      ];
  
  
  
     
  
      $scope.ddlrhs = '';
  
      $scope.data = [{
  
          Code: 1,
  
           Description: 'Red'
  
      }, {
  
          Code: 2,
  
           Description: 'Orange'
  
      }, {
  
          Code: 3,
  
           Description: 'Yellow'
  
      }, {
  
          Code: 4,
  
           Description: 'Green'
  
      }
      ];
        $scope.submit = function ()
      {
         
        
         $scope.list = [];
       
         
         
          for (var i = 0; i &lt; $scope.values.length; i++) {
              var j = "";
              $scope.list.push({
                  VALUE: $scope.values[i].Code,
                  Description: $scope.myForm.items[i].Description
                 
              })
          }
         
          $http({
              method: "POST",
              url: "/Controller/Save",
              data: 
                   $scope.list
                 
          })
      }
  
  
  }])</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.5/angular.min.js"&gt;&lt;/script&gt;
  &lt;div id="dvcollection" ng-App="myApp" ng-controller="ctrl" &gt;
          &lt;form name="myForm" &gt;
              &lt;table id="tblcollections"&gt;
  
                  &lt;thead&gt;
                      &lt;tr &gt;
                          &lt;th&gt;ItemCode&lt;/th&gt;
                          &lt;th&gt;ItemDesc&lt;/th&gt;
                          &lt;th&gt;DropdownDesc&lt;/th&gt;
                          &lt;th&gt;DropdownCode&lt;/th&gt;
                          &lt;th&gt;&lt;/th&gt;
                      &lt;/tr&gt;
                  &lt;/thead&gt;
                  &lt;tbody&gt;
                      &lt;tr ng-repeat="item in values"&gt;
                          &lt;td&gt;&lt;span&gt;{{item.Code}}&lt;/span&gt; &lt;/td&gt;
  
                          &lt;td&gt;{{item.Description}}&lt;/td&gt;
  
                          &lt;td&gt;
                              &lt;select ng-model="myForm.items[$index]" ng-options=" element.Description  for element in data "&gt;
  
                                  &lt;option value=""&gt;Select &lt;/option&gt;
                              &lt;/select&gt;
                              
                          &lt;/td&gt;
                          &lt;td&gt;&lt;span&gt;{{myForm.items[$index].Code}}&lt;/span&gt;&lt;/td&gt;
                      &lt;/tr&gt;
                      &lt;tr&gt;
                          &lt;td&gt;&lt;/td&gt;
                          &lt;td&gt;&lt;/td&gt;
                          &lt;td&gt;&lt;/td&gt;
                          &lt;td&gt;&lt;/td&gt;
                          &lt;td&gt;
                              &lt;input type="button" value="save" ng-click="submit()"style="float:right;" &gt;
  
                          &lt;/td&gt;
  
                      &lt;/tr&gt;
                  &lt;/tbody&gt;
              &lt;/table&gt;
  
          &lt;/form&gt;
      &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>