• Overview
@angular/cdk/drag-drop

DragDrop

Class
deprecatedsince v23

Service that allows for drag-and-drop functionality to be attached to DOM elements.

Deprecation warning

Use the createDragRef or createDropListRef function for better tree shaking. Will be removed in v23.

API

    
      class DragDrop {  createDrag<T = any>(element: any, config?: DragRefConfig | undefined): DragRef<T>;  createDropList<T = any>(element: any): DropListRef<T>;}
    
    

createDrag

DragRef<T>

Turns an element into a draggable item.

@deprecated

Use the createDragRef function that provides better tree shaking.

@paramelementany

Element to which to attach the dragging functionality.

@paramconfigDragRefConfig | undefined

Object used to configure the dragging behavior.

@returnsDragRef<T>

createDropList

DropListRef<T>

Turns an element into a drop list.

@deprecated

Use the createDropListRef function that provides better tree shaking.

@paramelementany

Element to which to attach the drop list functionality.

@returnsDropListRef<T>
Jump to details