drag-me
is a custom drag and drop module for angular applications provideing features like
- darg and drop any where in the dom
- custom callbacks for each event
- able to carry data in drag element
- custom styling
-
add to project using
npm i drag-me --save
-
Add
import { DragMeModule } from 'drag-me';
in App Module
imports: [
BrowserModule,
DragMeModule
],
<div dragMe [dragdata]="item" (ondrop)="onDrop($event)"></div>
NB:[dragdata]
is the data to carry,(ondrop)
is callback on drop
<div dropHere (dropped)='onDrop($event)'></div>
NB:(dropped)
is callback on drop
- On Dragging
drag-src
class is added to the dragging element and we can customize our own style over
class is added to the target element when drag over the item