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

Urls are not generating with # #53

Closed
dotnetwise opened this issue Oct 31, 2014 · 6 comments
Closed

Urls are not generating with # #53

dotnetwise opened this issue Oct 31, 2014 · 6 comments

Comments

@dotnetwise
Copy link

Our spa is not http://website/ but rather http://website/some/folder

The breadcrumb urls are not being generated with a hash # before:
e.g.
/home instead of #/home

Obviously this would fail the navigation.

Is there a setting to tweak?

@ncuillery
Copy link
Owner

You speak about the HTML5 mode right ?

The generation of href in links is totally delegated to the UI-router, and it supports HTML5 mode.

Do you add this line in your app configuration: $locationProvider.html5Mode(true) ?

The HTML5 mode requires specific settings on the server side: https://github.com/angular-ui/ui-router/wiki/Frequently-Asked-Questions#how-to-configure-your-server-to-work-with-html5mode

@dotnetwise
Copy link
Author

It's interesting that your example doesn't set $locationProvider.html5Mode(true) but works like a charm.

We don't have $locationProvider.html5Mode(true), and just in your breadcrumb links is missing the #

ui-sref directive seems to be generating the urls correctly with # hash

@ncuillery
Copy link
Owner

Oh right, maybe you are in this case: angular-ui/ui-router#1397

Do you use Angular 1.3 ?
In this case, you have to update the UI-router to the 0.2.12-pre1.

@dotnetwise
Copy link
Author

Yes! That indeed seems to be the issue.
0.2.11 installed from npm is not actually the correct version that you get after you do a grunt in theangular-ui-router itself.

So that's a bug, their release/angular-ui-router.js is not the same as build/angular-ui-router.js

Filled a bug there too
angular-ui/ui-router#1498

@dotnetwise
Copy link
Author

Btw, the 0.2.12-pre is not even published to npm as of today

@ncuillery
Copy link
Owner

Yes, as their names suggest, the release directory contains only the last release (made with the grunt release task) and the build directory contains an up-to-date but unstable build (made with default task).

It is exactly the same here (except my build directory is called dist).

Btw, the 0.2.12-pre is not even published to npm as of today

You can fill an other issue there ;)

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

2 participants