diff options
| author | Thibault Leruitte | 2013-03-08 14:53:54 +0100 |
|---|---|---|
| committer | Igor Minar | 2013-03-11 15:27:31 -0700 |
| commit | 346e98330c4c005044ad331aff2ccc400ad714b5 (patch) | |
| tree | fb570dc6e81c41316a28ca945a55314bbe577a78 /src | |
| parent | 2b1f10266a6632b2c4b0c3c143c22279345b9d8f (diff) | |
| download | angular.js-346e98330c4c005044ad331aff2ccc400ad714b5.tar.bz2 | |
fix($location): correctly rewrite html5 url to hashbang url
In situations where path() matched basepath and we needed to
convert from html5 url to hashbang url, the $location service
considered the url to be already rewritten, which resulted in
an error.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ng/location.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ng/location.js b/src/ng/location.js index 73ef7f7b..e6f629e5 100644 --- a/src/ng/location.js +++ b/src/ng/location.js @@ -79,7 +79,8 @@ function convertToHashbangUrl(url, basePath, hashPrefix) { var match = matchUrl(url); // already hashbang url - if (decodeURIComponent(match.path) == basePath) { + if (decodeURIComponent(match.path) == basePath && !isUndefined(match.hash) && + match.hash.indexOf(hashPrefix) === 0) { return url; // convert html5 url -> hashbang url } else { |
