Div在angular.js中可调整大小 [英] Div resizable in angular.js
问题描述
我想将可调整大小的jQuery UI集成到angular.js中,但无法做到, 我正在尝试使用angular.js中的调整大小句柄来调整div的大小,但是我没有这样做. 任何帮助都会很棒. 我已经创建了resize指令,并包含了可调整大小的jquery Ui js,但无法正常工作.
I want to integrating jquery UI resizable in angular.js but unable to do so, I am trying to resize the div with resize handle in angular.js but I am fail to do so. Any help will be great. I have already created resize directive and included jquery Ui js for resizable but its not working.
app.directive('resize', function() {
return {
// A = attribute, E = Element, C = Class and M = HTML Comment
restrict:'E',
//The link function is responsible for registering DOM listeners as well as updating the DOM.
link: function(scope, element, attrs) {
element.resizable();
}
};
});
预先感谢!
推荐答案
我认为元素对象是dom对象.将其包装在jQuery $
中,您可能会获得resizable()
方法
I think the element object is a dom object. Wrap it in jquery $
and you may get the resizable()
method
$(element).resizable();
还要确保在angularjs开始引导之前加载了jQuery ui脚本.
Also make sure jquery ui scripts are loaded before angularjs starts bootstrapping.
这篇关于Div在angular.js中可调整大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!