-
Notifications
You must be signed in to change notification settings - Fork 3k
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
$state.reload does not work if state have reloadOnSearch:false #1803
Comments
|
Hello, I have the same issue here. |
Unfortunately, I had to reload the entire page... So not user friendly.... |
I have the same issue here. I think the problem cold be in the code below (called by the function
https://github.com/angular-ui/ui-router/blob/master/src/state.js#L1375 Note that in the if, the value of options.reload is not considered if the reloadOnSearch is setted to false. When I have some time i pretend to do more tests and post a PR. If anyone want to do it before me, be free |
+1 |
1 similar comment
+1 |
Looks like a valid issue, but |
Is there any date when it will happen? |
As soon as possible. 😉 Trying for the middle of next week. |
@nateabele can you elaborate? Is there any docs on this new implementation? |
Not yet. The code isn't even finished. |
Okay, looking forward to it 😄 |
+1 |
This will remove so much garbage from my app around reloadOnSearch and $state.reload not working. Thanks so much. Can't wait. I know it hasn't been long but i am anxious to tear out all my crap code. Any update on time? |
Working on it this week. |
Hello @nateabele , did you make some progress on that topic ? |
My workaround for this issue
|
To anyone who sees this. My app is littered with garbage with work arounds which have evolved into worse workarounds because of this. What @j-hogue put is the idea i wish i had last year. Could have saved so much pain. Mine is a little different, but this seriously works, so much better then anything i have seen anyone post as a work around. And its simple.
|
@JobaDiniz thanks for the plunker. Here is your plunk updated to 0.2.15 code showing reloadOnSearch: |
Hi @christopherthielen cheers! |
Big thanks! I've tested in my project and it works perfectly. 👏 |
@christopherthielen you guys are kings! Thank you! |
My website has a header which contains a search field. This header is always shown, doesn't matter which state is the current state. When one submit the search form, they are redirected to search state with term param.
The search page (state) shows pagination widget, so when user clicks page 2, I change the query string but don't reload the state (that's why I use
reloadOnSearch:false
). However, the search form is still in the page. If user submits another search, only the term parameter will change and because of that, the page will not be reloaded. But I need to reload the page if user submits the search again.I've created a simple plunker to demonstrate.
I think
$state.reload
should reload the state, even if it hasreloadOnSearch:false
.I'm migrating from ngRoute, and
$route.reload()
reload the route even if it hasreloadOnSearch:false
.The text was updated successfully, but these errors were encountered: