How can i make a MatDialog draggable / Angular Material

前端 未结 4 937
情深已故
情深已故 2020-11-27 15:49

Is it possible to make a Angular Material Dialog draggable? I installed angular2-draggable and can of course use the functionality on all other elements.

But because

4条回答
  •  醉话见心
    2020-11-27 16:41

    in angular2-draggable, you use ngDraggable to make the element draggable. where ngDraggable is a directive and in your situation you need to attach this ngDraggable directive dynamically with your dialog which is created dynamically.

    Though officially, there is no way to add directive dynamically but some dirty tricks have been discussed in the following questions to add directive dynamically.

    How to dynamically add a directive?

    Use Angular2 Directive in host of another Directive

提交回复
热议问题