-
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
Fixes #125 Add reloadOnSearch property to stateConfig #593
Conversation
It says build failed, but that failing test is not the one we wrote and was already failing before we added our stuff in. |
@nateabele one thing I did want to point out in the code as a potential concern (though all tests are passing so we aren't too worried) is that when we were modifying the url with $location.search() it would trigger a state change because the url changed, and although You can see how our if (
to === from &&
(
(locals === from.locals && !options.reload) ||
(to.self.reloadOnSearch === false)
)
) So in essence reloadOnSearch doesn't necessarily care about the $location.search() value, it could potentially be used for other purposes of traveling to the same state without reloading. Also I'm wondering if we should have tied this in with options.reload somehow. |
I'd rewrite that as Also, the tests are failing because the list of states changed. Honestly, we should probably rewrite that test since it's pretty brittle in its current form, but just add |
@nateabele good idea on the refactor, will be much easier to read that way. @janders223 you got this? You've already got the repo pulled down. Need to refactor the |
@timkindberg I'll get on it |
That should pass the build now. |
Looks good. Squash your commits and we'll roll it. |
Thanks Jim! |
Add reload on search proprty to state config. Signed-off-by: Jim Anders <[email protected]> Fixes #125 Add reload on search proprty to state config. Signed-off-by: Jim Anders <[email protected]> Extract shouldTiggerReload Function
Fixes #125 Add reloadOnSearch property to stateConfig
reloadOnSearch
when set to false, allows the user to modify the search portion of$location
without reloading or reactivating a state.