【问题标题】:How to get md select value in angular js如何在角度 js 中获取 md 选择值
【发布时间】:2020-01-06 05:43:00
【问题描述】:

我想从 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>

【问题讨论】:

    标签: angularjs angularjs-material md-select


    【解决方案1】:

    您需要将数据存储到父“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 访问它

    【讨论】:

      猜你喜欢
      • 2020-12-25
      • 1970-01-01
      • 2018-03-05
      • 1970-01-01
      • 2019-01-23
      • 1970-01-01
      • 1970-01-01
      • 2019-08-28
      • 1970-01-01
      相关资源
      最近更新 更多