jack miao jack miao - 3 months ago 41x
AngularJS Question

How to implement drag and drop using angular 2 (v2.0.0-beta.15)

I want to implement a simple drag n drop list in angular, for example a groceries list that I can change its order.

I'm using angular

and I can't currently upgrade it so I have to find something that supports this version.

I found dragula which have wrapper for ng2 but not the version I have.

How do I implement drag and drop in Angular 2


You can use a specific revision from Dragula 2 Github repo.

1 - Open up package.json and scroll to "dependencies"

2 - Edit the ng2-dragula package to the Github link with the last commit before they switched to RC.1

"ng2-dragula": "git://github.com/valor-software/ng2-dragula.git#0cdcd52b1a486609ed4b4a43465b1dac2bb1b007"

3 - Delete the ng2-dragula folder in node_modules and reinstall it from your package.json with

npm install