Skip to main content

Posts

Showing posts from June, 2015

Simple and reusable directive for making list elements draggable.

I was working on Angular lists and needed a easy to implement and reusable solution to make list items draggable . I chose to implement the solution as an Angular directive so that I can pass scope references to the new helper controller and execute ng-repeat, as needed, to recreate Dom elements. After adding the helper controller, I was able to make ng-repeat lists in my application draggable by simply adding a custom attribute and passing the Angular collection name. Here is a Plunkr demo  and full GitHub source code .