diff options
| author | Vojta Jina | 2011-11-10 11:11:43 -0800 |
|---|---|---|
| committer | Misko Hevery | 2011-11-14 20:31:17 -0800 |
| commit | 5279de0e70e4f7c9c9607691c34b79d8c675695a (patch) | |
| tree | 5378dbf7f49f7b51ff8012400e48f9d8881afd1a /src/service/location.js | |
| parent | 8fe77b69e8008c6a432f9ef226586a09deb48c6c (diff) | |
| download | angular.js-5279de0e70e4f7c9c9607691c34b79d8c675695a.tar.bz2 | |
fix($location): links without path segment should not change the path
Closes #648
Diffstat (limited to 'src/service/location.js')
| -rw-r--r-- | src/service/location.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/service/location.js b/src/service/location.js index d7286291..4d82dfae 100644 --- a/src/service/location.js +++ b/src/service/location.js @@ -238,8 +238,9 @@ LocationUrl.prototype = LocationHashbangUrl.prototype = { return this.$$url; var match = PATH_MATCH.exec(url); - this.path(decodeURIComponent(match[1] || '')).search(match[3] || '') - .hash(match[5] || '', replace); + if (match[1]) this.path(decodeURIComponent(match[1])); + if (match[2] || match[1]) this.search(match[3] || ''); + this.hash(match[5] || '', replace); return this; }, |
