$scope.deleteStation = function (name, location) {
$http.delete(location).then(function () {
$scope.loadPage($scope.currentPageIndex(), function () {
$scope.addAlert('Station \'' + name + ' \' has been deleted!', 'success');
});
}, function (error) {
$scope.addAlert('Error happened: \'' + error.data.message + ' \'', 'danger');
});
};
Reload the whole page that can be very heavyweight. Consider removing objects from angular model instead full page reload:
delete $scope.page.stations[index]
Such requests:
Reload the whole page that can be very heavyweight. Consider removing objects from angular model instead full page reload: