Oskar Szura Oskar Szura - 1 year ago 180
AngularJS Question

AngularJS ng-drag

I'm new to AngularJS and I have a bit pressure on the current project that's why I'm asking here.

I see that AngularJS has ng-dragstart event (http://docs.ng.dart.ant.c-k.me/angular.directive/NgEventDirective.html) but it doesn't seem to work. On other pages I can see that other developers recommend to do new 'directives'.

So my question is: "Is there a native ng-drag functinallity implemented within AngularJS or should I implementi by myself?"

Answer Source

You can Use Angular Drag and Drop for AngularJS By codef0rmer. It's quite easy to implement and supports both angular and jquery callbacks for the events raised in drag and drop

In your case, for drag feature, you can write it as

<div class="btn btn-primary" data-drag="true" data-jqyoui-options="{revert: 'invalid'}" ng-model="list1" jqyoui-draggable="{animate:true}" ng-hide="!list1.title">{{list1.title}}</div>

I personally use it and found it very easy.

More Details Here