0

How do I copy some thing instead of moving it only when dragging it to a specific target.

I have 4 containers, and I want to make the value get copied to a container when something is dragged to it. For all the other containers I just want the value to get moved from source to target (as is the default behaviour).

The copy function in the ng2-dragula docs has only the element and source as arguments, but no target.

How do I achieve this?

Akash Srivastav
  • 756
  • 5
  • 15

1 Answers1

0

You can create dragover event and change copy option function run time.

HTML

<div (dragover)="changeMethod()"></div>

TS

changeMethod(){
  // here write logic for change option for target.
  this.copyOption = false;
}

i hope this will helps.

R. Viral
  • 386
  • 1
  • 6