Skip to content

Parse URL to get state #2166

@ashconnell

Description

@ashconnell

Is there a way to convert a url string (eg /posts/123) to a state (eg { stateName: 'app.posts', stateParams: { id: '123' } })

The API we need to interface with returns URLs instead of something more abstract such as states or type/identifier pairs

Simply calling $location.url(apiUrl) isn't feasible either as the Ionic Framework handles history internally.

It would be much cleaner to be able to go $state.parseUrl(apiUrl) to check if we even support the state before routing to it using $state.go(...)

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