From 9befe37014141fbfdf0cded318d28322fc058c13 Mon Sep 17 00:00:00 2001 From: Thibault Leruitte Date: Fri, 8 Mar 2013 14:53:54 +0100 Subject: 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. --- src/ng/location.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/ng') 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 { -- cgit v1.2.3