Santhosh Aineri
Santhosh Aineri

Reputation: 559

How to redirect to another page and refresh it in angularjs?

On button click i am calling a function like this

<a href="#" ng-click="submit()">Submit</a>

My controller code is like this

$scope.submit = function(){
    $state.go('app.calendar');
}

This code is taking me to calendar page. But after that page should reload. Can anybody help me..

Upvotes: 0

Views: 1382

Answers (2)

Upalr
Upalr

Reputation: 2148

use this::

$scope.submit = function(){
  $location.path('/calendar'); //need to add the path of calendar page
}

Upvotes: 2

uksz
uksz

Reputation: 18699

You are looking for

$state.go('app.calendar', {}, {reload: true})

Upvotes: 0

Related Questions