![](/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.