【问题标题】:Using jquery Uniform plugin with AngularJS使用带有 AngularJS 的 jquery Uniform 插件
【发布时间】:2015-01-06 04:11:14
【问题描述】:

我正在使用以下 AngularJS 指令将 Uniform jQuery 插件与 angularjs 集成

myApp.directive('pluginUniform', function() {
    return {
        restrict: 'A',
        link: function(scope, element, attrs) {
            element.show().uniform();
            if (!element.parents(".checker").length) {
                element.show().uniform();
            }

        }
    };
});

我遇到的问题是它没有显示检查 ng-checked="true" 值。但是当我删除 plugin-uniform 属性时,它会显示正确的结果。

例如,在控制器中设置了值$scope.isEmailChecked = true;,但是下面的代码ng-checked="isEmailChecked"没有显示选中的复选框。

<div class="">
    <label>
        <input type="checkbox" plugin-uniform ng-model="isEmailChecked" ng-true-value="true" ng-false-value="false" ng-checked="isEmailChecked">
        I agree 
    </label>
</div>

有人可以帮我解决这个问题吗?

【问题讨论】:

    标签: javascript jquery angularjs checkbox jquery-uniform


    【解决方案1】:

    试试这个:

    window.onload = function(){       
        // initiate layout and plugins
        ...
        setTimeout(function(){ $.uniform.update(); }, 300);
    };
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-11-12
      • 1970-01-01
      • 2011-10-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-02-01
      • 2017-09-24
      相关资源
      最近更新 更多