0

I'm using ng2-dragula to drag and drop elements. I need that my drag&drop be in one direction

for example I have a menu of items and I fill my div with this items so its not logical to drag from my div to menu.

I had already found this config to keep my items in menu

 this.dragulaService.setOptions('first-bag', {
            copy: true,
        });
khalil _diouri
  • 791
  • 3
  • 12
  • 34

1 Answers1

0

Add an 'id' to your menu and change your setOptions as follow:

this.dragulaService.setOptions('first-bag', {
  accepts: function (el, target, source, sibling) {
    return (target.id != 'dragula-source');
  },
  copy: true
});
Lesrac
  • 65
  • 2
  • 14