You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
$location.search() produces an empty object, rather than { bar: 'baz' }.
I understand that it's looking only at the part of the URL following #!, but I'm wondering if that's really the correct way to go - it certainly makes it difficult to extract and use those query parameters (without using separate URL parsing code for window.location). Is this just not what $location is for? The docs say:
The $location service parses the URL in the browser address bar (based on the window.location) and makes the URL available to your application." which suggests it should parse the whole URL.
I'd also expect that given a URL like this, not in HTML5 mode:
http://foo.com/?bar=baz#!/?qux=quux
I'd expect $location.search() to be { bar: 'baz', qux: 'quux' } - the merged set of query parameters.
When not in HTML5 mode, given a URL like this:
$location.search()produces an empty object, rather than{ bar: 'baz' }.I understand that it's looking only at the part of the URL following
#!, but I'm wondering if that's really the correct way to go - it certainly makes it difficult to extract and use those query parameters (without using separate URL parsing code forwindow.location). Is this just not what$locationis for? The docs say:I'd also expect that given a URL like this, not in HTML5 mode:
I'd expect
$location.search()to be{ bar: 'baz', qux: 'quux' }- the merged set of query parameters.