Agularjs数据删除功能不起作用 [英] Agularjs datatable delete function is not work
问题描述
<tr ng-repeat="lop in table1.lops">
<td>{{ lop.idate }}</td>
<td>{{ lop.patient }}</td>
<td>{{ lop.type }}</td>
<td>{{ lop.ssn }}</td>
<td>{{lop.carrier}}</td>
<td> <button type="button" ng-click="removeItem(lop)" class="btn btn-sm btn-danger">
<i class="glyphicon glyphicon-remove-circle">
</i>
</button></td>
js
js
function activate() {
// Ajax
$resource('server/rebill.json').query().$promise.then(function(lops) {
vm.lops = lops;
});
vm.removeItem = function removeItem(lop) {
var index = vm.rowCollection.indexOf(lop);
if (index !== -1) {
vm.rowCollection.splice(index, 1);
}
}
}
我尝试过:
我尝试使用删除功能的数据表,但它不工作我生病检查控制台错误
但它没有显示即时尝试修复此错误,但我无法找到它我应该误解它我不会没有
plz帮助我学习开发人员
What I have tried:
im try to datatable using delete function but its not work i ill check the console-error
but its nothing show im try to fix this error but i cant find it what i should mistake it i dont no
plz help me for learning developer
推荐答案
resource(' server / rebill.json')。query() 。
resource('server/rebill.json').query().
promise.then( function (lops){
vm.lops = lops;
} );
vm.removeItem = function removeItem(lop){
var index = vm.rowCollection.indexOf(lop);
if (index!== -1){
vm.rowCollection.splice(index, 1 跨度>);
}
}
}
promise.then(function(lops) { vm.lops = lops; }); vm.removeItem = function removeItem(lop) { var index = vm.rowCollection.indexOf(lop); if (index !== -1) { vm.rowCollection.splice(index, 1); } } }
我尝试过:
我尝试使用删除功能的数据表,但它不工作我生病检查控制台错误
但它没有显示即时尝试修复此错误,但我无法找到它应该误解我不要没有
plz帮助我学习开发人员
What I have tried:
im try to datatable using delete function but its not work i ill check the console-error
but its nothing show im try to fix this error but i cant find it what i should mistake it i dont no
plz help me for learning developer
这篇关于Agularjs数据删除功能不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!