秦小小樱

导航

select 取value值

<md-select ng-model="alarmSelect" style="margin: 0px 0px 0px 0px;" ng-change="sss(alarmSelect)"  auto-id ="alarm_select">
            <md-option value = "active" selected="selected"   auto-id = "alarm_active"  ><span translate="frameworkLocales.en_GB.active">Active</span></md-option>
           <md-option value ="history" auto-id="alarm_histroy"><span translate="frameworkLocales.en_GB.historical">Historical</span></md-option>
 </md-select>

直接$scope.alarmSelect是取不到的

可以在ng-change的方法传入ng-model的值

$scope.sss = function(data){
// alert(data);
$scope.alarmSelect = data;
};

或者用$("###").val();进行取值

posted on 2018-07-11 11:19  RonnieQin  阅读(435)  评论(0编辑  收藏  举报