我使用以下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>
有人可以帮我解决这个问题吗?
答案 0 :(得分:2)
试试这个:
window.onload = function(){
// initiate layout and plugins
...
setTimeout(function(){ $.uniform.update(); }, 300);
};