我有项目,我使用单页.....我已通过下一步连接ui angular lib:
我添加了脚本
<script src=.....jquery-1.9.1.js"></script>
<script src=.....jquery-ui.js"></script>
<script src=".....1.2.4/angular.min.js"></script>
<script src=.....sortable.js"></script>
比我添加的模块:
var app = angular.module('abilitonDashboard', ['ngRoute', 'ngLoadScript','ui.sortable']);
并且在parrent上添加了属性ui-sortable =&#34; sortableOptions&#34; 例如在表格中:
<tbody ui-sortable="sortableOptions">
<tr>
<td> 1 </td>
<td> 1 </td>
<td> 1 </td>
</tr>
<tr>
<td> 2 </td>
<td> 2 </td>
<td> 2 </td>
</tr>
<tr>
<td> 3 </td>
<td> 3 </td>
<td> 3 </td>
</tr>
</tbody>
答案 0 :(得分:0)
试试这个:
<!DOCTYPE html>
<html ng-app="MainApp">
<head></head>
<body>
<table>
<tbody ui-sortable="sortableOptions">
<tr>
<td> 1 </td>
<td> 1 </td>
<td> 1 </td>
</tr>
<tr>
<td> 2 </td>
<td> 2 </td>
<td> 2 </td>
</tr>
<tr>
<td> 3 </td>
<td> 3 </td>
<td> 3 </td>
</tr>
</tbody>
</table>
<script src="jquery.js"></script>
<script src="angular.js"></script>
<script src="jquery-ui.js"></script>
<script src="sortable.js"></script>
<script>
angular.module('MainApp', ['ui.sortable'])
</script>
</body>
</html>