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);
...
}