reppners / ngx-drag-drop

Angular directives using the native HTML Drag And Drop API
https://reppners.github.io/ngx-drag-drop/
BSD 3-Clause "New" or "Revised" License
299 stars 118 forks source link

add "type" in dndDrop event #41

Closed hordesalik closed 5 years ago

hordesalik commented 5 years ago

Currently, when I'm using dndType property it is not possible to determine it in dndDrop event, there is no such property. I expected "type" property to be the same as I set in dndType. Workaround to get dropped item type is to pass object into dndDraggable input like this: [dndDraggable]="{item: control, type: 'control'}" and then in dndDrop($event) it is available in $event.data.type;

Reason: I need to use different logic when different types of data dropped into dropzone

reppners commented 5 years ago

Thanks for your follow up PR. Merged and released as of v1.1.0 / v2.0.0-rc.3 🎉