-
Notifications
You must be signed in to change notification settings - Fork 3k
no state change when navigating to a URL where only parameters change #289
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
Comments
Please add your use case to a Plunkr and add the link here. Thanks. |
Happy to, but a dumb question first. Is there an easier/better way to use a dev version of ui-router in a plunker, short of uploading my own built angular-ui-router.js to the individual plunker? The thing is, the bug I'm filing seems to be a regression since 0.0.1; it works fine with http://angular-ui.github.io/ui-router/release/angular-ui-router.js and fails with the one I build myself. |
The "is this a different state" test I'm sparring with is relatively new. |
Nope, that's the way for now. Thanks for putting the test together. Should be able to get it worked out over the weekend. |
Absolutely hilarious. I was just about to enter a new issue for this until I saw the fix has already been committed. Thanks, @nateabele |
perfect, exactly what I needed when migrated from original angular routing |
I'm trying to use ui-router and ran into a problem where if I attempt a transition between a state with params and the same state with different params, nothing happens.
In my use so far, I'm replacing existing use of ngRoute with ui-router components, so all the states have (distinct) URLs, and I'm using
<a href>
to transition between states.Say I have a state
users
, defined something likestate('users', { url: '/users', /* controller, template, etc */ })
and a stateusers.view
, defined something likestate('users.view', { url: '/:username', ... })
. If we navigate from/
to/users/foo
, we see a state transition intousers.view
with params including{ username: 'foo' }
. If we then navigate to/users/bar
, there's no further state transition.In fact, I see urlRouterProvider's internal
update()
routine run and match the route and invoke thewhen
handler added by $StateProvider.registerState(). But that handler's($state.$current.navigable != state)
test decides there's nothing to do. So no state transition happens, and as far as I can tell nothing else happens.(I saw #46, but this seems to be different. And I tried putting a watch on $state.params from the controller, but the watch doesn't fire.)
If I comment out that test at line 119 of state.js, so that it always invokes $state.transitionTo, it works more like I'd expect.
Here's a minimal repro case:
The text was updated successfully, but these errors were encountered: