【问题标题】:ng-model value not updating from chosen plugin dropdownng-model 值未从所选插件下拉列表中更新
【发布时间】:2014-09-05 11:34:09
【问题描述】:

我有一个用于搜索下拉列表的 jquery 选择插件。通常我会触发更改更新以更新值。这里我的 ng-model 没有更新。请帮忙。

<span> <form:select name="country" path="" id="country" 
                    class="searchBoxWidth" ng-model="CarrierDetails.country">
                    <form:options items="${countryList}" />
                </form:select>

$('#country').change(function(){
        $("#country").trigger("chosen:updated");

    })

我应该使用 $scope.apply 之类的东西还是观看或消化。我希望有一个角度解决方案。 或者我应该像

一样把它分配回去
$scope.CarrierDetails.country=$("#country:selected").val();

【问题讨论】:

标签: angularjs jquery-chosen


【解决方案1】:

最好切换到 Angular-chosen(AngularJS 包装器)

https://github.com/localytics/angular-chosen

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-07-09
    • 1970-01-01
    • 1970-01-01
    • 2017-01-03
    • 1970-01-01
    • 2016-07-02
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多