我正在尝试使用Angular UI和jQuery UI Sortable来模仿连接列表的行为。
但是,这种行为非常不稳定:http: //jsfiddle.net/hKYWr/227/有 什么想法吗?
HTML:
<div ng:controller="controller">
<ul class='mysortable' ui:sortable ui:options="{connectWith:'.mysortable'}" ng:model="list1">
<li ng:repeat="item in list1" class="item">{{item}}</li>
</ul>
<ul class='mysortable' ui:sortable ui:options="{connectWith:'.mysortable'}" ng:model="list2">
<li ng:repeat="item in list2" class="item">{{item}}</li>
</ul>
<hr>
<pre ng-bind="list1 | json"></pre>
<hr>
<pre ng-bind="list2 | json"></pre>
</div>
<script src="http://code.angularjs.org/1.0.2/angular.min.js"></script>
<script src="https://raw.github.com/angular-ui/angular-ui/master/build/angular-ui.min.js"></script>
JS:
var myapp = angular.module('myapp', ['ui']);
myapp.controller('controller', function ($scope) {
$scope.list1 = ["1", "2", "3"];
$scope.list2 = ["A", "B", "C"];
});
angular.bootstrap(document, ['myapp']);
CSS:
ul {
display: inline-block;
}
.item {
padding: 2px;
width: 50px;
height: 20px;
border: 1px solid #333;
background: #EEE;
}