簡體   English   中英

如何在angular js中獲取md選擇值

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM