-
Notifications
You must be signed in to change notification settings - Fork 3k
Proposal for nested states #903
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
Comments
Really appreciate your work on this, and your being persistent in working on getting it resolved. A few thoughts in response:
Internally, yes. This shouldn't break the way people are currently defining states. Also, anywhere that a fully-qualified state name is required, (i.e. This is important (a) because of the ability to move sub-trees around, and (b) to also have sub-trees that can be attached at multiple points on the main tree, which are both features that are frequently requested and are being planned for the future. I assume you already agree with this, I just want to be clear.
This should only be direct descendants. Otherwise, traversing the state tree will be needlessly complicated. If there needs to be an easy way to retrieve all descendants, we can have a getter method.
I think keeping all 4 ways does make sense, in light of the planned features mentioned above.
Sweet, sounds good to me. |
Rock on, love it! I look forward to seeing the implementation. |
Any news on this? |
@timkindberg unfortunately not. It might be a few weeks before I have the time for this. |
@marklagendijk No worries, take your time, and thanks for your thoughts so far. We have plenty of other things to focus on in the meantime. |
What's the latest thinking on this? I ran into some issues today and have had various issues over the years with nested states being tricky to define. Could be wrong but felt like there were extra wrinkles with lazy-loading, too. |
This issue has been automatically marked as stale because it has not had This does not mean that the issue is invalid. Valid issues Thank you for your contributions. |
Relates to #346 and #368.
Currently there are 4 ways of defining states:
name: 'contacts.list'
parent: 'contacts'
parent: contacts
(where 'contacts' is an stateObject)My proposal is to make the logic of stateHelper a part of ui-router itself, and make sure that all ways of defining nested states give a consistent result:
parent
property. This parent property contains the state object of its parent.children
property. This property contains all the child states of the state.This way the different ways of declaring nested states always produce a consistent result. I think this consistency is very important.
We should also consider whether it would still make sense to support al 4 ways. In my opinion way 3 and 4 wouldn't add anything when 1 and 2 are already supported in the way I described above.
@nateabele, @timkindberg, I would like your opinion about this. I would be willing to implement this functionality, including tests.
The text was updated successfully, but these errors were encountered: