我试图在我的表格中拖放行 - angularjs。我当前的代码是
<div ng:controller="controller">
<table style="width:auto;" class="table table-bordered">
<thead>
<tr>
<th>Index</th>
<th>Count</th>
</tr>
</thead>
<tbody ui:sortable ng:model="list">
<tr ng:repeat="item in list" class="item" style="cursor: move;">
<td>{{$index}}</td>
<td>{{item}}</td>
</tr>
</tbody>{{list}}
<hr>
</div>
<script src="http://code.angularjs.org/1.0.2/angular.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/angular-ui/0.4.0/angular-ui.min.js"></script>
我的 Controller 代码是
var myapp = angular.module('myapp', ['ui']);
myapp.controller('controller', function ($scope) {
$scope.list = ["one", "two", "thre", "four", "five", "six"];
});
angular.bootstrap(document, ['myapp']);
它在 http://jsfiddle.net/xfmh6ywm/ 中运行良好但不能使用 http://jsfiddle.net/9z4zn9uz/ 中的相同代码.即使在我的网站中,也与后者类似,我无法重新排列行。
最佳答案
关于javascript - 在 jsfiddle 中拖放表中的行不起作用 - angularjs,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27979950/