Subhajit Subhajit - 1 month ago 10
AngularJS Question

AngularJS $state.go with full page refresh

Seems like $state.go('statename') works like a back button in the browser. A cached Type.

I need to refresh the page when state changes like clicking the refresh button in the browser.

I need to reload/refresh the full page when the state changes, basically re-initializing the controller.

Tried with $state.go('statename', {}, {reload: true}), but with no effect.

Help would be appreciated

Answer

If you don't mind injecting $window, you can try with $window.location.reload()