Skip to content

Allow "random" optional parameters in url #1401

Closed
@RodolpheGohard

Description

@RodolpheGohard

I need to use optional parameters in my URLs, such as:

example.org/#search?text=optional%20params&orderBy=DATE

here, either text or orderBy are optional and can be independently present. So that won't allow constructions like search/:text/:orderBy.

And the parameters are absent from $state.params or $stateParams.

I have to use $locationChangeSuccess events combined $location.search() and
it's not practical at all. Partly because it fires before state changes.

It would be neat if there were an event like $stateUpdated, and also if
optional parameters were included in $stateParams.
Or maybe there's already some mechanism for this in UI router, if so please
tell me.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions