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:26:38 -0700
commit9befe37014141fbfdf0cded318d28322fc058c13 (patch)
treec33159cda36edfe1ec1528570d7a359516cc5834 /src/ng/location.js
parente88d6179c3a6a137e75fa09de906fc83c6515db2 (diff)
downloadangular.js-9befe37014141fbfdf0cded318d28322fc058c13.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 {