This repository was archived by the owner on Apr 12, 2024. It is now read-only.
fix($location): always resolve relative links in html5mode to <base> url
#8851
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
BREAKING CHANGE (since 1.2.0 and 1.3.0-beta.1):
Angular now requires a
<base>tag when html5 mode of$locationis enabled. Reasoning:Using html5 mode without a
<base href="...">tag makes relative links for images, links, ...relative to the current url if the browser supports
the history API. However, if the browser does not support the history API Angular falls back to using the
#,and then all links would be broken.
BREAKING CHANGE (since 1.2.17 and 1.3.0-beta.10):
In html5 mode without a
<base>tag on older browser that don't support the history APIrelative paths were adding up. E.g. clicking on
<a href="page1">and then on<a href="page2">would produce
$location.path()==='/page1/page2'. The code that introduced this behavior was removed and Angular now also requires a` tag to be present when using html5 mode.Closes #8172