title: How to get key and value from selected options in Controller Angularjs
body: <p>I using Angularjs, and trying to get in controller, from view, selected options (key and value) in select.</p>
  
  <p>How to get - key, I know, but how to get key and value?</p>
  
  <p><strong>View:</strong></p>
  
  <pre><code>&lt;select
      ng-change="Main.getLocalityByAddress(regions)"
      ng-model="regions"
      ng-options="data.id as data.name for data in Main.regions"&gt;
  
      &lt;option value&gt;{{"Select region" | localization:'index'}}&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p><strong>Controller:</strong></p>
  
  <pre><code>Main.getLocalityByAddress = function(selected_region) {
  }
  </code></pre>
  
  <p><strong>Upd:</strong></p>
  
  <p>Whats wrong?:</p>
  
  <p><strong>Controller</strong></p>
  
  <pre><code>app.controller('Main', function($scope){
      var Main = {};
  
      $scope.getLocalityByAddress = function() {
          console.log($scope.regions); // undefined
      };
  
      $scope.Main = Main;
  });
  </code></pre>
  
  <p><strong>View</strong></p>
  
  <pre><code>&lt;select
      ng-change="getLocalityByAddress()"
      ng-model="regions"
      ng-options="data.name for data in Main.regions"&gt;
  &lt;/select&gt;
  </code></pre>