【问题标题】:(Chosen) Combobox Plugin using AngularJS(选择)使用 AngularJS 的组合框插件
【发布时间】: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


    【解决方案1】:

    这个video解释了Angularjs中jQuery插件的实现。

    注意,使用最新的 jQuery 库:chosn-select 必须替换为 chosen-selectliszt: update 将在触发更改时替换为 chosen:updated

    This 是最新的 github 存储库。节点以下unresolved issue

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-04-26
      • 2016-05-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多