0

i want to reload when clicking the href.

<li><a ng-href="#/detailedView">DetailedView</a></li>

so i have added the below method in controller js.

$scope.reloadRoute = function() {
$state.reload();
}

and modified the href like below, but still its not reloading.

<li><a ng-click="reloadRoute()" ng-href="#/detailedView">DetailedView</a></li>

i have tried $route.reload(); as well, but the page is not getting refreshed while clicking the href

Marjer
  • 1,313
  • 6
  • 20
  • 31

1 Answers1

0

Looks like you are using ui-router?

In that case you can use a statement like this from the html:

<a ui-sref="<state-name-for-detailed-view>" ui-sref-opts="{reload: true}">DetailedView</a>

And that should reload the page. More info here

There are some other options on this SO page

Community
  • 1
  • 1
bwobbones
  • 2,398
  • 3
  • 23
  • 32