Search code examples
angulardrag-and-dropangular-cdk

Angular CDK drag & drop doesn't work in component, but works in mat dialog - angular js wrapper


Maybe this Q&A can seems useless for somebody, but I was stuck with this for more than a week.

I've got a task to add drag & drop functionality to one of lists in the project.
It should bed easy, because it was used in other place in the project. So I copied the code from the working component and it didn't work. It was the same part of the application so I thought that it's the same module. So I thought that it can be related to MatDialog and AngularJS router that is used by the project.


Solution

  • Always remember to check if the component that you want to add drag & drop to is in the module that imports DragDropModule.