How to get md select value in angular js

102 Views Asked by At

i want to to get value from md select but i don't know how to do that

<md-option ng-value="{"region":"United Arab Emirates","country_code":"ae","url":"google.ae"}">Test
</md-option>

I want to get value from select option and create a link Like This

 <a href="www.(my url link get here from select)/&gl=(my country_code get here from select)"></a>
1

There are 1 best solutions below

0
allkenang On

You need to store the data into the "model" attribute of the parent "md-select".

<md-select ng-model="someModel">
   <md-option ng-value="{"region":"United Arab Emirates","country_code":"ae","url":"google.ae"}">Test
   </md-option>
<md-select>

The value is then set to the variable "someModel" in your Controller and you typically access it via $scope.someModel