gentle gentle - 2 months ago 10
AngularJS Question

How to refresh the page upon successful submission using angularJS

Hi how to refresh an html page upon successful submission?
I've tried as follows, but its not working.

$scope.submit =function(){
data = {};
angular.extend(data, $scope.final_data);
angular.extend(data, { checks : $scope.final_data.checks });
$'{% url 'submit' %}', data).success(
alert('succesfully submitted');
$location.path('{% url 'orc_checkbinning' %}');
alert('not submitted');

Am using Django framework for my project. Any idea? Thanks in advance.


I think the best, is update the scope with the data submited, but
If you really wants refresh the page, try this:

You can use the reload method of the $route service. Inject $route in your controller and then create a method reloadRoute on your $scope.

$scope.reloadRoute = function() {

SO post