How to use Angular7 (angular material) drag drop between two components
As recently angular introduced drag and drop in angular material https://material.angular.io/cdk/drag-drop/overview . All examples describes with in a single component. How to use this in two different components, Drag one component item and drop into another component. You may use properties id and cdkDropListConnectedTo to link both lists: Component 1: <div cdkDropList id="list-1" cdkDropListConnectedTo="list-2" (cdkDropListDropped)="drop($event)"> <div *ngFor="let item of list" cdkDrag>{{ item }}</div> </div> Component 2: <div cdkDropList id="list-2" cdkDropListConnectedTo="list-1"