Agularjs数据删除功能不起作用 [英] Agularjs datatable delete function is not work

查看:85
本文介绍了Agularjs数据删除功能不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆