title: Get selected value in angular js
body: <p>I am new to angular.I was making a simple demo for select in which I will add new select according to current value selected. I am usig dynamic value for options and for model as well. I am not able to get the selected value please help.</p>
  
  <p>HTML code goes here:</p>
  
  <pre><code>&lt;md-input-container ng-repeat="a in selects" class="md-block"  style="margin-top:20px;"&gt;
        &lt;label&gt;{{a.label}}&lt;/label&gt;
        &lt;md-select required  ng-model="a.model" ng-change="callme()" flex="40"&gt;
          &lt;md-option ng-model="a.model" ng-repeat="optionValue in a.options" ng-value="optionValue.option"&gt;
              {{optionValue.option}}
          &lt;/md-option&gt;
        &lt;/md-select&gt;
        &lt;div class="errors" ng-messages="petApp.favoriteColor.$error"&gt;
              &lt;div ng-message="required"&gt; You need to select a option&lt;/div&gt;
        &lt;/div&gt;
    &lt;/md-input-container&gt;
  </code></pre>
  
  <p>JS code goes here</p>
  
  <pre><code>$scope.selects =  [{label:"Your Pet",model:"pet",options:[{option:"Cat"},{option:"Dog"},{option:"Guinea pig"}]}];
  
  $scope.callme = function(){
    console.log($scope.pet);
    $scope.selects.push({label:"Your Pet",model:"pet",options:[{option:"Cat"},{option:"Dog"},{option:"Guinea pig"}]});
  }
  </code></pre>
  
  <p>Here the model name is pet while I do $scope.pet it is giving undefined.</p>