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) {});
}
};