title: How to get value from dropdown list with angularjs
body: <p>I populated a select box with data from the backend and it works well, but when I click on an item to get its value, it gives me undefined:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;div class="col-md-5"&gt;
    &lt;label class="child-label" for="existing-phases"&gt;Existing:&amp;nbsp;&amp;nbsp;&lt;/label&gt;
    &lt;select class="form-control" ng-model="MyData"&gt;
      &lt;option disabled selected value&gt;-- select an option --&lt;/option&gt;
      &lt;option ng-repeat="var in payloadSecteur" value="{{var.id}}"&gt;{{ var.secteur }}
      &lt;/option&gt;
    &lt;/select&gt;
    &lt;a class="btn btn-primary add-contract-button pull-right" ng-click="showPopup()"&gt;+&lt;/a&gt;
  &lt;/div&gt;
  </code></pre>
  
  
  
  <p>Here's the function:</p>
  
  <pre><code>$scope.showPopup=function(){
    alert('eee');
    alert($scope.MyData);
  };
  </code></pre>