![](/img/trans.png)
[英]How to get the display text and value in angular js material md-select
[英]How to get md select value in angular js
我想从 md select 中获取价值,但我不知道该怎么做
<md-option ng-value="{"region":"United Arab Emirates","country_code":"ae","url":"google.ae"}">Test
</md-option>
我想从选择选项中获取价值并创建一个像这样的链接
<a href="www.(my url link get here from select)/&gl=(my country_code get here from select)"></a>
您需要将数据存储到父级“md-select”的“model”属性中。
<md-select ng-model="someModel">
<md-option ng-value="{"region":"United Arab Emirates","country_code":"ae","url":"google.ae"}">Test
</md-option>
<md-select>
然后将该值设置为控制器中的变量“someModel”,您通常通过 $scope.someModel 访问它
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.