Drag and drop module for Angular JS

Angular Core Dependency: latest

Module License: MIT

Added by: Sam Deering





Stars: 579

Watchers: 579

Forks: 364

Module Description


Drag and drop module for Angular JS with support for touch devices. demo.


  • Install: bower install ngDraggable
  • Add angular and ngDraggable to your code:
<script src="//"></script>
<script src="ngDraggable.js"></script>
  • Add a dependency to the ngDraggable module in your application.
angular.module('app', ['ngDraggable']);
  • Add attribute directives to your html:

Draggable usage:

<div ng-drag="true" ng-drag-data="{obj}" ng-drag-success="onDragComplete($data,$event)" ng-center-anchor="true">
  Draggable div
  • ng-center-anchor is optional. If not specified, it defaults to false.
  • If the draggable is also clickable (ng-click, ng-dblclick) the script wont react.
  • You can define a drag-button as child with the attribute ng-drag-handle.

ng-drag-start and ng-drag-move is also available. Add to the ng-drop element. ng-drag-stop can be used when you want to react to the user dragging an item and it wasn't dropped into the target container.

draggable:start, draggable:move and draggable:end events are broadcast on drag actions.

Drop area usage:

<div ng-drop="true" ng-drop-success="onDropComplete($data,$event)" >
  Drop area

Angular Controller:

app.controller('MainCtrl', function ($scope) {
       console.log("drag success, data:", data);
        console.log("drop success, data:", data);


Drag and drop.




Pull requests

We welcome pull requests but please check that all the examples still work if you modified the source base. There have been serveral PRs recently that broke core functionality. If you are feeling really keen you could include some protractor test cases in your PR.

Module stats last updated: 2018-01-22 16:00:02

Disclaimer: Some data on this page may have been gathered from the authors GitHub respository. If you see any mistakes or outdated information please let us know. Thanks!