2

i have a question about using angular-dragdrop.

Here is the code: http://plnkr.co/edit/sNZ3xQK1fYMlBf8rX5Kb?p=preview

I want to drag first section item into second section. These section are different controller and how to fix that?

2 Answers 2

1

Agreed, I'm late to the party but one of the contributors had provided a patch to the same problem you are facing because I did not consider such scenario (multi controller drag & drop) while writing it.

I've updated the angular-dragdrop.js file in your demo to make it work. Hope you like it!

http://plnkr.co/edit/lWwHD0TGIiEw6p7imQtz?p=preview

Sign up to request clarification or add additional context in comments.

Comments

0

Please go through the AngularJS Directives documentation. All UI code has to be inside directives.

It is ok for both sections to have their own controllers. Basically you need to add directives to both section templates. On the directive that is the target section, you handle the appropriate JQuery callback and either use scope.broadcast/scope.on or use services to communicate between the controllers.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.