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

When starting from deep url, state doesn't get detected #250

Closed
akarelas opened this issue Jul 13, 2013 · 17 comments
Closed

When starting from deep url, state doesn't get detected #250

akarelas opened this issue Jul 13, 2013 · 17 comments

Comments

@akarelas
Copy link

Please visit my terribly simple website:

http://gist1.perlmodules.net:8080/

The links work, nested views come into existance fine.

However when you visit this link DIRECTLY (click on this link): http://gist1.perlmodules.net:8080/a/funny then no state is detected, and no views get downloaded and displayed.

Am I doing something wrong? Have I forgotten something?

@akarelas
Copy link
Author

I checked, and this bug doesn't occur when html5Mode is turned off. It looks like a bug to me.

@laurelnaiad
Copy link

Try three things, just for kicks:

  1. define a state that maps to url '/' instead of just plunking your home screen on there without it being a defined state
  2. have a ui-view element in index.html where your views will be rendered
  3. put in the in index.html

@akarelas
Copy link
Author

@stu-salsbury What was number 3 again? Put the what in index.html?

@akarelas
Copy link
Author

@stu-salsbury With "2" are you suggesting that the ui-view attribute is not good enough?

@akarelas
Copy link
Author

gist2 is exactly like gist1 except with suggestions "1" & "2" of your message applied, @stu-salsbury

Still, the following URL doesn't show any content in the black box when you visit it by clicking this link: http://gist2.perlmodules.net:8080/a/funny

@laurelnaiad
Copy link

With "2" are you suggesting that the ui-view attribute is not good enough?

I totally missed it above the script. I also screwed up recommendation 3 b/c it was html
try putting

<base href="/">

in the head element.

@laurelnaiad
Copy link

and if that don't work, show us your url rewriting configuration -- I have a feeling it's not finding the partials.

@akarelas
Copy link
Author

Magic, it WORKED! http://gist2.perlmodules.net:8080/a/funny

Please tell me how you figured that out? Why was that needed? Was it in the documentation?

@akarelas
Copy link
Author

Thanks 👍

@laurelnaiad
Copy link

it's a bug/feature in angular -- they're working on it... for now, base href is kinda necessary to get things to go the way we all want them to.

@akarelas
Copy link
Author

It should be written in the documentation. That could also be considered a fix if I'm not mistaken. Please write <base href="/"> in the documentation.

@laurelnaiad
Copy link

Keep in mind that it's angular's bug, not ui-router's. It only appeared in 1.1.5 (I think), and it's only recently been tracked down.

That said, it's a severe bug to be sure, and while it's out there, I would agree that it's probably worth putting base href in the ui-router examples and in the documentation. Heck, until they get it fixed it seems like angularjs should also be doing a better job of publicizing it. I've seen so many people on stackoverflow with this problem, I've lost count.

One issue is that the bug is all tangled up with the concept of running in subdirectories (or not running in subdirectories) and running in hashbang mode or html5 mode... the inconsistencies in the current buggy behavior is complicated enough that it would be difficult to document exactly what everyone needs to do in each use case until the fix/change is released (presumably in angular 1.1.6).

@timkindberg
Copy link
Contributor

Where or what pages in the docs do you think I would add a warning about this? Sorry I don't fully understand that issue and the solution... I'm not sure how I'd write it up...

@akarelas
Copy link
Author

I'll let @stu-salsbury answer your question... I'm just a beginner.

@laurelnaiad
Copy link

I tweaked the FAQ a little based on my partial understanding of the issue.

@timkindberg
Copy link
Contributor

Thank you!

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