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

1

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.