angular cdk drag and drop code example
Example 1: angular install @angular/cdk/drag-drop
$ npm install @angular/cdk
# or, using Yarn:
$ yarn add @angular/cdk
Example 2: drag and drop angular
<div cdkDropList class="example-list" (cdkDropListDropped)="drop($event)">
<div class="example-box" *ngFor="let movie of movies" cdkDrag>{{movie}}</div>
</div>
Example 3: angularJs drag and drop
<div class="thumbnail" data-drop="true" data-jqyoui-options ng-model="list2" jqyoui-droppable style='height:50px;'> <div class="btn btn-success" data-drag="false" data-jqyoui-options ng-model="list2" jqyoui-draggable ng-hide="!list2.title">{{list2.title}}</div></div>
Example 4: angularJs drag and drop
<div class="btn btn-primary" data-drag="true" data-jqyoui-options="{revert: 'invalid'}" ng-model="list1" jqyoui-draggable="{animate:true}" ng-hide="!list1.title">{{list1.title}}</div>
Example 5: angular material drag and drop only on button
<div class="example-box" cdkDrag>
I can only be dragged using the handle
<div class="example-handle" cdkDragHandle>
<button class="btn move" cdkDragHandle>
<mat-icon>open_with</mat-icon>
</button>
</div>
</div>