Skip to content

Update of child scopes broken #234

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

Closed
m7r opened this issue Jul 7, 2013 · 5 comments
Closed

Update of child scopes broken #234

m7r opened this issue Jul 7, 2013 · 5 comments

Comments

@m7r
Copy link

m7r commented Jul 7, 2013

To reproduce run the example at current head and try to switch between alice and bob.
Nothing happens. Switching between contact.list and contact.detail works as aspected.

If you change the url manually there is the same problem. Only in html5 mode it works, as the browser reloads the hole page.

It looks like the problem was introduced with 2874694

@ksperling
Copy link
Contributor

hmmm... I guess the problem is that we're not comparing parameters in that code, but that would get pretty complicated.

Maybe another option for avoiding the $location problem with non-navigable states would be for $state to remember the last URL that it thinks $location should have, and only do a transition if they differ. I.e. we'd update that location

  • after we've processed a $location / $urlMatcher handler
  • after we've updated $location in transitionTo()

@nateabele thoughts?

@nateabele
Copy link
Contributor

@ksperling You don't think it would work to compare $match to $stateParams? (I guess once your parameter work is complete, we would have to compare the encoded version of each param...)

Or, could we just generate a URL for the other state and compare them directly?

@ksperling
Copy link
Contributor

The problem with generating a URL in the route handler and comparing to the current state is that there can be multiple representations of the same URL (e.g. query parameter order can differ, but there may be other ways).

The problem we were trying to fix in the original change was that an update to $location we initiate ourselves causes an instant transition; so the simplest fix would seem to be to remember that we've set the url to X, so if we get a callback that the url is now X on the next digest cycle, we know we can just ignore it.

@nateabele
Copy link
Contributor

Yeah okay, that makes more sense now. Sounds good to me.

@nateabele
Copy link
Contributor

Fixed in fdc1156 (see #289).

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

No branches or pull requests

3 participants