JSFiddle - React, Tailwind, and code Playground
by solitary90
HTML
<script src="http://rubaxa.github.io/Sortable/Sortable.js"></script>
<script src="http://rubaxa.github.io/Sortable/ng-sortable.js"></script>
<div ng-app="myApp" ng-controller="demo" class="ng-scope">
<ul ng-sortable="sortable">
<li ng-repeat="item in items">{{item}}</li>
</ul>
<ul ng-sortable="sortable">
<li ng-repeat="item in items2">{{item}}</li>
</ul>
</div>
JavaScript
var app = angular.module('myApp', ['ng-sortable']);
app.controller('demo', function ($scope) {
$scope.items = ['learn Sortable',
'use gn-sortable',
'Enjoy'];
$scope.items2 = ['learn amgular',
'use directive',
'Enjoy!'];
$scope.sortable = {
group: "name",
animation: 150,
onAdd: function ( /**Event*/ evt) {
var itemEl = evt.item; // dragged HTMLElement
evt.from; // previous list
console.log(evt, itemEl, evt.from)
// + indexes from onEnd
},
};
});