更新时间:2023-02-05 22:54:12
No need to move jQuery before angularjs. Just wrap the element inside $, so that jQuery will understand that DOM and bind resizable event properly. Instead of link use compile if you are not dependent on scope and Compile is comparatively faster than link.
Directive code.
routerApp.directive('resizeable', function() {
return {
restrict: 'A',
compile: function(element, attrs) {
$(element).resizable({
resize: function(event, ui) {
jsPlumb.repaint(ui.helper);
},
handles: "all"
});
}
};
});
Hope this will helpful to you.