2.0.0 • Published 7 years ago

asb-dnd v2.0.0

Weekly downloads
30
License
MIT
Repository
github
Last release
7 years ago

Drag and drop directives for Angular

This Angular module consists of two Angular directives that allow yo to drag elements and drop them into any droppable element.

Draggables can hold any JSON-serializablea payload that will be delivered to the droppable.

Installation

Drag and Drop library can be installed via npm

npm install asb-dnd --save

Sample code

Please see to this plunker for a full working example.

Usage

To use these directives you have to import AsbDragAndDropModule in your app module.

import { NgModule } from '@angular/core';
/* ... */
import { AsbDragAndDropModule } from 'asb-dnd';

@NgModule({
  imports     : [AsbDragAndDropModule /*, ... */],
  /* ... */
})
export class MyApplicationModule {
}

Directives

asbDraggable

asbDraggable enables HTML dragging on a given component.

Attributes

AttributeTypeDefaultDescription
asbDraggable@Input()falseConverts the component into an HTML draggable
asbDraggableData@Input()nullThis will be the payload associated to the drag event.
asbDraggableType@Attribute()draggableType of the draggable

asbDroppable

asbDroppable enables dropping of draggables on a given component. This directive accetps a comma-separated list of asbDraggableTypes.

If the draggable type is accepted by this droppable, class dragover is added to the component. In other case, then classes will be dragover and forbidden added.

Attributes

AttributeTypeDefaultDescription
onDrop@Output()Event to emit when a drop has occured
asbDroppable@Attribute()draggableComma-separated list of asbDraggableTypes
2.0.0

7 years ago

1.2.3

7 years ago

1.2.2

7 years ago

1.2.1

7 years ago

1.2.0

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago