Skip to content

Wildcard * parent state #1014

@shmatul

Description

@shmatul

Each parent state on my app should be available to a child state named "deals/:dealId".
For instance:

state('parent.categories/:catId', {}) can load the 'deals' state:
/categories/clothing/deals/123

state('parent.search/:term', {}) can load the 'deals' state:
/search/nike/deals/123

and so on.

As for the current situation, I have to define the "deals" state for each and every available parent state:

state('parent.categories.deals')
state('parent.search.deals')

Now - maybe I'm not entirely focused on how ui-router works,
but this case has to be available on my app and I couldn't find any proper solution for it.

If I could use a wildcard state parenting that would be simple awesome:
state('*.deals');

BTW
I tried using a dynamic variable for the state name (currentState+'.deals') but it only catches the default currentState var that has been declared.
If I change currentState the 'deals' state won't be effective on the new current parent state.

Thank you.

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