Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Should $location extract search params from before the #! ? #5964

Closed
@bhollis

Description

@bhollis

When not in HTML5 mode, given a URL like this:

http://foo.com/?bar=baz

$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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions