0

I have used datatable in angular. I am trying to delete item. First time it works completely fine but second time it shows an error.

Error: [ng:areq] Argument 'scope' is required

Below is my code.

$scope.dtInstance = {};
$scope.reloadData = function () {
    var resetPaging = true;
    $scope.dtInstance.rerender();
};

$scope.removeCompany = function (companyId) {
    if ($window.confirm("Are you sure !")) { //start if click on ok

        companyFactory.companyInfo(companyId, 'DELETE')
        .success(function (res) {
            $scope.reloadData();

            notify({
                message: 'Company has deleted!',
                classes: 'alert-danger',
                templateUrl: 'views/common/notify.html'
            });
        })
        .error(function (err) {});
    }
};
Satpal
  • 132,252
  • 13
  • 159
  • 168
Dishant
  • 19
  • 3

0 Answers0