Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html ng-app="demo">
<head>
  <meta charset="utf-8">
  <title>Sortable: group</title>
  <!-- AngularJS -->
  <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js"></script>
  <!-- Sortable.js -->
  <script src="http://rubaxa.github.io/Sortable/Sortable.js"></script>
  <!-- ng-sortable.js -->
  <script src="http://rubaxa.github.io/Sortable/ng-sortable.js"></script>
  
</head>
<body ng-controller="DemoController">
  
  <ul ng-sortable="{group: 'ng', animated: 100}">
    <li ng-repeat="item in firstList">{{item}}</li>
  </ul>
  <ul ng-sortable="sortableOptions">
    <li ng-repeat="item in secondList">{{item}}</li>
  </ul>
  first: {{firstList.length}}<br/>
  second: {{secondList.length}}
  
</body>
</html>
 
ul {
  list-style: none;
  padding: 0;
}
li {
  background: #eee;
  margin: 1px;
  padding: 10px 15px;
  cursor: move;
  border-radius: 5px;
}
.sortable-ghost {
  opacity: .4;
}
 
angular.module('demo', ['ng-sortable'])
  .controller('DemoController', ['$scope', function ($scope) {
    $scope.firstList = ['foo 1', 'foo 2', 'foo 3'];
    $scope.secondList = ['bar 1', 'bar 2'];
    $scope.sortableOptions = {
      group: 'ng',
      animation: 200
    }
}]);
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
RubaXapro
0viewers