aboutsummaryrefslogtreecommitdiffstats
path: root/src/ng/location.js
diff options
context:
space:
mode:
authorThibault Leruitte2013-03-08 14:53:54 +0100
committerIgor Minar2013-03-11 15:27:31 -0700
commit346e98330c4c005044ad331aff2ccc400ad714b5 (patch)
treefb570dc6e81c41316a28ca945a55314bbe577a78 /src/ng/location.js
parent2b1f10266a6632b2c4b0c3c143c22279345b9d8f (diff)
downloadangular.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/ng/location.js')
-rw-r--r--src/ng/location.js3
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 {