返回顶部

angularJS——select下拉框检测改变

 

html:(已引入amazeUI)

<div style="width:70px;display:inline-block;">
     <form class="am-form am-form-inline" >
         <div class="am-input-group am-form-icon am-form-feedback ">
             <span class="am-input-group-btn">
                 <select ng-model="type" ng-options="t.value as t.name for t in typeOptions" 
            class
="am-form-field am-input-sm" id="typeOption" ng-change="typeChange()"> //注:一定是typeChange(),而不是typeChange </select> </span> </div> </form> </div>

 

js:

$scope.type = '1';
$scope.typeOption
= [{   name:'全部',   value:'1' }, { name:'今天', value:'2' }, { name:'昨天', value:'3' }, { name:'上一月', value:'4' }];

$scope.typeChange = function(){
  console.log('type',$scope.type);
  ...
}
posted @ 2019-11-14 10:06  前端-xyq  阅读(968)  评论(0编辑  收藏  举报