AngularUI modal to be draggable and resizable

前端 未结 6 495
逝去的感伤
逝去的感伤 2021-02-04 02:19

I have an angularUi modal window wrapped in a directive:

html:



  
    

        
6条回答
  •  太阳男子
    2021-02-04 02:47

    If you don't want to modify built-in templates you can write a directive that targets modalWindow:

    .directive('modalWindow', function(){
        return {
          restrict: 'EA',
          link: function(scope, element) {
            element.draggable();
          }
        }  
      });
    

    Please note that you will have to load both jQuery and jQuery UI before AngularJS scripts.

    NOTE: Also keep in mind that newer versions of Angular UI bootstrap have been prefixed with "uib" so "modalWindow" becomes "uibModalWindow" with thanks to @valepu

提交回复
热议问题