Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider allowing FQN addressing for states w/ parent: #5

Closed
christopherthielen opened this issue Nov 8, 2016 · 3 comments
Closed

Comments

@christopherthielen
Copy link
Member

christopherthielen commented Nov 8, 2016

angular-ui/ui-router#3119
ui-router/react#11
angular-ui/ui-router#3181

If the state is defined using parent: notation, you cannot reference it by including the parents name. For example if a state is declared like this:

{
  parent: 'home',
  name: 'foo'
}

And you cannot create a sref such as ui-sref='home.foo' because home is not technically part of the name of the state.

This also affects glob patterns in transition hooks. Is not currently possible to match foo using this criteria object:

{ to: 'home.**' }
@mfidemraizer
Copy link

IMO, I believe that state paths should be agnostic on how they're defined. It should be a common syntax like CSS selectors.

I've not reviewed the implementation yet, but I guess that the magic is done based on a convention-based engine against state paths. If this is the case, maybe the solution is to turn paths into something that should be parsed, but internally UI router should store everything based on object properties (i.e. using parent).

So I think that above approach would guarantee backwards compatibility while providing more power to handle the whole issue scenario. BTW, any code using parent instead of a path would be broken.

Maybe state configuration might define a parameter like legacy defaulting to true... And/or a service parameter also called legacy to define what should be the default value to legacy if each state doesn't provide it explicitly...

@cadilhac
Copy link

cadilhac commented Feb 23, 2018

Revisiting this issue... Did something change about globs and dot notation?

@stale
Copy link

stale bot commented Jan 24, 2020

This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs.

This does not mean that the issue is invalid. Valid issues
may be reopened.

Thank you for your contributions.

@stale stale bot added the stale label Jan 24, 2020
@stale stale bot closed this as completed Feb 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants