且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在 JsPlumb 小部件上启用调整大小?

更新时间: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"
      });
    }
  };
});

Working Plunkr

Hope this will helpful to you.