【发布时间】:2013-09-02 15:18:39
【问题描述】:
html在下面
select(data-placeholder="Choose State", ng-model="districtCourtState")#stateselected
option( ng-repeat='state in StatesofIndia', value= "{{state}}") {{state}}
以上代码是ng-controller='inputForm_Controller' 的一部分,包含在下面,如下所示:
$(document).ready(function(){
$(".chosen-select").chosen();
$("#stateselected").chosen().change( function() {
alert($scope.districtCourtState);
});
});
上面第一次给出了正确的选择选项警报,但从第二次开始,StatesofIndia = ['a', 'b', 'c', 'd']
它始终将选择 + 1 作为$scope.districtCourtState 的值,即如果选择了“a”,则给出了“b”的alert,依此类推。
【问题讨论】:
标签: jquery angularjs combobox drop-down-menu jquery-chosen