0
我有一个表100行,如果我进入一个新的排它增加了它,并在表的顶部显示为降序按日期滤波器阶与AngularJs
<table class="table">
<tr ng-repeat=" item in itemlist | orderBy:createdat:true">
<td>//code goes here</td>
<td><button ng-click="del(item)" class="fa fa-trash"></button></td>
</tr>
</table>
我有一个所有CRUD操作删除按钮,但问题是,当我删除任何特定的行时,它只删除该特定行,但仍显示该行存在于表中,直到页面被刷新。因此,任何想法..这将是对我很大的帮助.... 下面是代码....只是在JS文件中的代码复制plunker
在HTML
<div ng-app>
<div ng-controller="FooController">
<table>
<tr ng-repeat="item in items | orderBy:'num':true">
<td>{{item.num}} :: {{item.desc}}</td>
<td><button class="fa fa-trash" ng-click="del($index)">
delete
</button></td>
</tr>
</table>
</div>
function FooController($scope) {
$scope.items = [
{desc: 'a', num: 1},
{desc: 'b', num: 2},
{desc: 'c', num: 3},
];
$scope.del=function(idx){
$scope.items.splice(idx,1)
}
}
你可以创建plunker吗? –
太宽泛。也许创建一个演示。 – dfsq
因此,您的代码中存在一个错误,并希望找到并修复该错误。我们怎么能没有看到你的代码呢? –