-
Notifications
You must be signed in to change notification settings - Fork 3k
No hash urls and browser history #148
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
Regarding enabling non-hashbang URLs, please refer to the following from the page you linked to: $locationProvider.html5Mode(true) For history tracking, we have an existing open issue: #52. |
How would you configure UI-Router to support browser urls that do not contain a hash sign at all yet would still be bookmarkable and when loaded into the browser by a user would return the page to the state when the user captured the url ? I'm not referring to hash-bang urls with both hash and an exclamation point. I'd like to know if it is possible to skip the hash character entirely. I cannot see at the moment why Angular's $locationProvider would affect any of the UI-Router urls - as far as I can tell UI-Router never uses $locationProvider and ignores it when resolving urls. |
@doliver3 Sounds like your new to Angular? UI-Router uses Providers are just service factories, they can then be used during configuration to pre-configure the service they create ones you enter runtime and that service is requested. This is useful for stuff that should not be configurable during runtime. |
It sounds like you're not familiar with how this works? Angular and UI-Router will help you write a single-page app, but some server-side configuration is usually required to ensure that subordinate URLs of the application always resolve to the same HTML page. Provided this, UI-Router will correctly transition back to the state matching the URL given by the user. @timkindberg maybe we should include this in the FAQ or a guide for beginners? I can supply rewrite configurations for nginx and Apache. |
I've had some issues with HTML5 mode. Here's what I know:
|
@nateabele good idea. Honestly it's a bit confusing to me as well so I'd also love a FAQ on this. |
Maybe rewrites for express too? |
@timkindberg Alright, I'll write one up this week. I can do Apache, nginx, and vanilla Node configurations, but I don't know Express. Do you? On May 26, 2013, at 10:46, Tim Kindberg [email protected] wrote:
|
No but I'll read a tutorial :) |
It would be neat if the 'dev' task in the Gruntfile could be tweaked so that the http server it starts is configured to run the (or a) sample app in html5 mode. |
This is what I just came up with for a sample I was working on for express. js, css and partials are under my app root. Dist is one level up from the app root. I had no idea how to use express and still don't know much, but HTH :)
|
Awesome thanks @stu-salsbury |
Added to docs: https://github.com/angular-ui/ui-router/wiki/Frequently-Asked-Questions#how-to-configure-your-server-to-work-with-html5mode @nateabele feel free to add other rewrites for Apache, nginx, and vanilla Node configurations. |
@timkindberg Just added Apache. I'll dig up my nginx configuration in a little bit. |
You rock! |
Hi,
I didn't see a way to use UI-Router without a Hash in the Url, and I would like to request this as a feature enhancement if it is not a current capability.
Angular and HistoryJS seem to have determined a way with modern Html5 browsers history API to avoid the hash in the url. Is this possible with UI-Router ? How could this be done ?
http://docs.angularjs.org/guide/dev_guide.services.$location
https://github.com/browserstate/history.js/
Thanks,
David
The text was updated successfully, but these errors were encountered: