-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
default location to hash allow path via ExtraOptions #9502
Comments
I can't agree more. HashLocationStrategy should have been the default. Reasons?
Let's be honest here. Most of the people using angular will not implement server-side rendering of their angular components. This means that when your end users refresh their browser they will get a 404 (or a redirect to the home page if you play it smart). Please make HashLocationStrategy the default and allow people to skip fragment stripping. If somebody wants badly "pretty urls" she can do the extra mile of supporting server side rendering and enabling it. The documentation is also misleading.
It should say that you must implement server-side rendering if you want to fully support the HTML5 routing style. This Tour of Heroes tutorial suffers from the same problem. Open the live demo in plunker, load it in a separate window, navigate anywhere and refresh the browser ... 'NOT FOUND'. |
@akorchev server-side rendering is not related to |
Having html5 pushState as the default forces new users to learn/know about build tools. The concern here is mostly for developers who are new to angular2 and/or even client-side web development. It's also a lot easier to reason about single page apps when you understand that it's loading one page (the index.html) and we're using javascript to fake routes with the hash. Having the html5 pushState forces the developer to know more about how servers work. If a new developer is also setting up a server in node/express for the first time, it's also easy to fall into common pitfalls of making sure they don't serve everything as index. For example, a new developer may mess up the order and now all of the assets are serving the index.html this can lead to recursive requests. Where of the index.html loads a resource that loads yet another index.html |
I know that one could add a redirect to index.html. However I am not sure this is the right choice because
|
It is a breaking change, so we cannot make until the end of 2017. And I don't think this the cost justifies the benefit here. Closing this issue. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
From @gdi2290 on June 21, 2016 1:5
the default location should be HashLocationStrategy while PathLocationStrategy could be set via ExtraOptions
Copied from original issue: angular/vladivostok#96
The text was updated successfully, but these errors were encountered: