-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Switching to path location strategy #472
Comments
hash location strategy is easier to understand how a SPA works. Even if the goal is having html5 support |
I was thinking the goal of this repository was to get people up to speed with an Angular 2 project instead of teaching them about how SPA works. But if the intention is more towards the second I will happily close. |
Does the Path Location Strategy fall back automatically to Hash Location Strategy? :) |
@samvloeberghs nope :) |
@samvloeberghs the bootstrap code could probably use Modernizr to detect if the history API is there or not and adapt the config based on that. IMHO IE9 shouldn't be considered anymore anyways, time to move on. Microsoft dropped support, let's not live in the past. Ask people to move to a modern Web browser :) |
@spawnius @dsebastien totally up for that! But why do we still have Hash Location Strategy than.. Can't think of a case other than IE9 |
@samvloeberghs - while IE9 without push state support might be one of the reasons, the major one I see is when you don't want to delegate handling of deep links to the front end. Example: ngnix web server is handling / while the SPA is handling /# based routes. |
I was going to open an issue relating to path location strategy, but it might be more appropriate here. Maybe @spawnius can help me out. I'm using path location strategy. On my server, nginx is handling incoming requests and sending them off to either the front-end server or the backend (api) server. I can't get non-root routes to work on refresh without specifying all routes like the
If I remove the Any ideas? |
@louisscruz this is a question for stackoverflow as it is an implementation specific matter. |
FYI I've added support for push-state in the production build of my fork (dev mode being ok with the |
@spawnius I totally understand. It's just that I've already made 4 or 5 posts on SO and Serverfault about this issue over the past few months. No luck. I personally think that it would be great if someone did a wiki on this, if anyone actually understands how this implementation should work. @dsebastien I'm going to check out your setup/superstatic later. Thanks! |
I spent days wondering why back clicks weren't working. I thought i was supposed to add the following to the app.routes.ts file like the official docs state:
I then imported this into the bootstrap and everything appeared to work as push state except back clicks. Took me forever before I realized that location strategy is being forced and I'm not supposed to use provideRouter I guess, even though I have no clue what it actually does. |
Thanks @dsebastien for you suggestion, it's exactly what i am looking for!!! |
I'm submitting a question about the decisions made in the repository.
Currently the starter is using hash location strategy for the routing by default. Why not switch to path location strategy?
I believe most users want to be html5 compliant out of the box. Browser support for Angular 2 includes only IE9+ with more recent versions of Chrome, Firefox and Opera, so it's not an issue.
The text was updated successfully, but these errors were encountered: