(pt 手 机)angularjs select 选中的值怎么获取
1个回答
展开全部
加个ng-model绑定对象。直接用对象的值即可
<select ng-model="selectModel" ng-options="item.value as item.text for item in itemList" ng-change="changeSelect()"></select>
app.controller('controllerName', function($scope){
$scope.selectModel = '';
$scope.changeSelect = function(){
alert($scope.selectModel);
}
})
<select ng-model="selectModel" ng-options="item.value as item.text for item in itemList" ng-change="changeSelect()"></select>
app.controller('controllerName', function($scope){
$scope.selectModel = '';
$scope.changeSelect = function(){
alert($scope.selectModel);
}
})
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询