1.添加 ng-click="delete($index)
<!--標(biāo)簽內(nèi)容-->
<div class="list_body active">
<ul>
<li class="item" ng-repeat="item in taskList">
...
<!--注冊刪除事件-->
<span class="del" ng-click="delete($index)">刪除</span>
<span class="detail">詳情</span>
</li>
</ul>
</div>
2.添加刪除方法 index.js
app.controller('taskController', ['$scope', function ($scope) {
...
//定義刪除方法
$scope.delete = function (key) {
//刪除key元素, 刪除1個(gè)
$scope.taskList.splice(key, 1);
}
}]);