<select name="" id="" ng-model="currenttype">
<option value="null">---请选择---</option>
<option ng-repeat="r in roles" value={{r.emp_id}}>{{r.emp_name}}</option>
</select>
$scope.currenttype="";
$scope.$watch('currenttype',function(){
alert($scope.currenttype);
})
![图片描述][1]
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
那是因为在执行
repeat的时候ng-model尚未有值 ,你可以发现空白的那个option中会有一个value="?"给一个初始化话的值就好了
$scope.currenttype=$scope.roles[0];就好
model没有初始化啦