答案 0 :(得分:1)
是的,有可能。假设数据以ng-repeat与表达式绑定,
tblShipments
因此,您需要在json数据中再添加一个属性。
答案 1 :(得分:1)
检查此样本...... 它会在3秒后删除删除红旗......
http://jsfiddle.net/leojavier/U3pVM/18175/
<div class="field" ng-app="App">
<table ng-controller="Controller">
<tr ng-repeat="item in table">
<td ng-class="item.style" ng-class="item.style">{{item.name}}</td>
<td><a href="javascript:void(0)" ng-click="delete(item, $index)">Delete</a></td>
</tr>
</table>
</div>
JS
var App = angular.module('App', []);
App.controller('Controller', function($scope, $timeout){
$scope.table = [
{name : 'Dan', deleted:false},
{name : 'Orlando'},
{name : 'Dany'}
];
$scope.delete = function(item, index){
item.deleted = true;
item.style = 'deleted';
function destroy() {
$scope.table.splice(index, 1)
}
$timeout(function(){destroy();}, 3000);
}
});
CSS
body{
font-family:arial;
}
a{
text-decoration:none;
color:red;
}
table{
width:300px;
}
td{
border:thin solid #CCC;
padding:10px;
}
tr{
position:relative
width:300px;
}
.deleted:after{
content:'DELETED';
position:absolute;
top:0;
left:0;
background:red;
width:300px;
color:#FFF;
text-align:center;
line-height:40px;
}