2
votes

When I add [cdkDragFreeDragPosition] to a div I get the following error:

enter image description here

I tried to apply this same example: https://stackblitz.com/angular/bxalqlqlaly?file=src%2Fapp%2Fcdk-drag-drop-free-drag-position-example.ts

Example:

<div class="example-box" cdkDragBoundary=".example-boundary" cdkDrag [cdkDragFreeDragPosition]="dragPosition">
  <h2>Test</h2>
</div>
1

1 Answers

0
votes

You need to import DragDropModule in NgModule. After that only drag drop will work. Please refer this link for more information. https://material.angular.io/cdk/drag-drop/overview