Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ui.router.state.$state options (optional) reload (v0.2.5) #1933

Closed
borm opened this issue May 3, 2015 · 12 comments
Closed

ui.router.state.$state options (optional) reload (v0.2.5) #1933

borm opened this issue May 3, 2015 · 12 comments

Comments

@borm
Copy link

borm commented May 3, 2015

http://angular-ui.github.io/ui-router/site/#/api/ui.router.state.$state

reload (v0.2.5) - {boolean=false}, If true will force transition even if the state or params have not changed, aka a reload of the same state. It differs from reloadOnSearch because you'd use this when you want to force a reload when everything is the same, including search params.

Where version 0.2.5?
Or how reload page after state.go()

@borm
Copy link
Author

borm commented May 3, 2015

I have find only one solution
state.go('myState')
change to
location.href = '/myStateUrl'

@eddiemonge
Copy link
Contributor

Why are you using such an old version? Latest is 0.2.14. Try upgrading to that (or 0.2.13) and see if your issue is fixed.

@the-simian
Copy link

I might be able to help, It appears the poster is referencing the docs here : https://github.com/angular-ui/ui-router/wiki/Quick-Reference#reloadonsearch-v025

I will say that there appears to be some breaking change introduced in the latest version of ui-router. When using state.go to transition to a state you are already in, I am experiencing a bug where it will not update the params and transition anyways (such as on a search page, using params to indicate the various search params)

I will post more when I zero in on what is actually calling the break. Even passing the
{ reload: true }
options as an optional third parameter is not forcing a reload, currently.

I can confirm the bug is in 0.2.14 and not0.2.13 I will submit a separate issue for it if I can.

@christopherthielen
Copy link
Contributor

@the-simian does your state have reloadOnSearch=false? . Also check if the activity in #1079 affects your issue.

Please submit your new issue ASAP since we want to get 0.2.15 out right away to fix the bugs introduced in 0.2.14 that are not in 0.2.13

@the-simian
Copy link

@christopherthielen I checked for that also, sorry I failed to mention it. I was wanting to try and repro with a plunkr. I'll go ahead and get the issue open, to catch anyone else looking for the same thing.

@the-simian
Copy link

#1963 now is created. I will try and make a simple example to repro.

@christopherthielen
Copy link
Contributor

@borm can you please clearly state what the problem is? I cannot tell what you are asking.

@borm
Copy link
Author

borm commented May 20, 2015

@christopherthielen

"name": "angular-ui-router",
"version": "0.2.14",

I need reload page in browser after state.go('myState') complete

@christopherthielen
Copy link
Contributor

you want to reload the browser? Like re-fetch the JS and HTML and CSS from the server?

If so, that's not a function of UI-Router. Use standard browser functions instead: https://developer.mozilla.org/en-US/docs/Web/API/Location/reload

However, if you simply want to reload the UI-Router state (remaining in the running SPA), then use $state.go('myState', {}, { reload: true });

@borm
Copy link
Author

borm commented May 20, 2015

@christopherthielen
I know that,
I thought that you have a method to reload the page

Close

@eddiemonge
Copy link
Contributor

@christopherthielen not $state.reload()?

@christopherthielen
Copy link
Contributor

@eddiemonge $state.reload() would probably be better, yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants