1.2.0 • Published 3 years ago

@ildug/ngx-dragdrop v1.2.0

Weekly downloads
6
License
MIT
Repository
github
Last release
3 years ago

ngx-dragdrop

Angular directives for passing data with Drag & Drop.

Demo

See demo

Install

Install via package manager or fork this project ("projects/ngx-dragdrop/src")

NPM

npm install @ildug/ngx-dragdrop

YARN

yarn add @ildug/ngx-dragdrop

Usage in angular app

Import the module in your angular app. In your module app.module.ts

    ...
    import { NgxDragdropModule } from '@ildug/ngx-dragdrop';

    @NgModule({
        declarations: [
            AppComponent,
        ],
        imports: [
            ...
            NgxDragdropModule,
            ...
        ],
        bootstrap: [AppComponent]
    })
    export class AppModule { }

dagDrag

Add the directive to an element to give it the draggable behaviour. Then assign a value to an element witch will be dragged.

In my.component.html

<div [dagDrag]="item" > drag me </div>

dagDrop

Add the directive to an element to give it the droppable behaviour. Listen for the drop event and get dropped data

<div (dagDrop)="useItem($event)" > drop here </div>

When the draggable element enter in drop area, drop-over class is added to this element.

To Do

  • drag-start and drag-end events emitters
  • drag-enter and drag-leave events emitters
1.2.0

3 years ago

1.1.0

4 years ago

1.0.1

5 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago