1
如何將拖放到我的列表中?AngularJS |如何包含拖放列表?
文件:list.tpl.html
<div class="panel-body">
<table class="table table-striped">
<thead>
<tr>
<th>Lp.</th>
<th>Nazwa</th>
<th>Estymacja</th>
<th>Data</th>
<th>Ico</th>
<th>Zaznacz jako wykonane</th>
</tr>
</thead>
<tr data-ng-repeat="todo in todos">
<td>{{$index+1}}. </td>
<td><span class="done-{{todo.done}}">{{todo.title}}</span></td>
<td><span class="done-{{todo.done}}">({{todo.estimates}}h)</span></td>
<td><span class="done-{{todo.done}}">{{todo.date}}</span></td>
<td><span class="glyphicon glyphicon-{{todo.type.gico}} done-{{todo.done}}"></span></td>
<td><input type="checkbox" data-ng-model="todo.done" title="Mark Complete" /></td>
</tr>
</table>
文件:列表ctrl.js
app.controller('listCtrl', function ($scope) {
$scope.deleteCompleted = function() {
$scope.$parent.todos = $scope.$parent.todos.filter(function (item) {
return !item.done;
});
};
});
我學習AngularJS,所以感謝您的幫助!
從我的理解,你需要使用某種插件,並不直接支持拖放。看起來像「angular-dragdrop.js」就是其中之一。 – VSO