Skip to content

docs(router): clarify router.navigate() behavior with relativeTo and commands array#67723

Closed
anushkasingh-commits wants to merge 4 commits intoangular:mainfrom
anushkasingh-commits:patch-8
Closed

docs(router): clarify router.navigate() behavior with relativeTo and commands array#67723
anushkasingh-commits wants to merge 4 commits intoangular:mainfrom
anushkasingh-commits:patch-8

Conversation

@anushkasingh-commits
Copy link
Contributor

Summary

Adds a small clarification to the router.navigate() documentation to address confusion when using the commands array with relativeTo.

Changes

  • Clarified how command arrays may behave differently when split vs combined
  • Added note about absolute navigation when using / with relativeTo

Notes

  • Change is minimal and placed within the existing section
  • No structural or conceptual changes introduced

Fixes #65657

@pullapprove pullapprove bot requested a review from JeanMeche March 17, 2026 12:25
@angular-robot angular-robot bot added area: docs Related to the documentation area: router labels Mar 17, 2026
@ngbot ngbot bot modified the milestone: Backlog Mar 17, 2026
@JeanMeche JeanMeche requested a review from atscott March 17, 2026 12:35
@anushkasingh-commits
Copy link
Contributor Author

Thanks for the clarification! I've updated the wording to focus specifically on parent route navigation.

…elativeTo

Clarified usage of 'relativeTo' option for parent routes.

You can also build dynamic navigation paths relative to your component’s location in the routing tree using the `relativeTo` option.

When navigating to parent routes using `relativeTo`, parent segments should be provided as a single command (for example `'../../path'`). Splitting them into multiple entries (e.g. `'..', '..', 'path'`) may not produce the expected navigation result.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean by “may not” and what are “expected results? Documentation should focus on what the behavior does not what it does not do

@anushkasingh-commits
Copy link
Contributor Author

Thanks for the clarification! I've updated the wording to clearly describe the actual behavior instead of using ambiguous phrasing.

@atscott atscott closed this Mar 17, 2026
@anushkasingh-commits
Copy link
Contributor Author

Thanks for the review! I understand the feedback regarding focusing on actual behavior. I’ll refine this approach in future contributions.

@JeanMeche
Copy link
Member

Sorry but this isn't working for us. Reviewing your contributions is more work that doing it ourselves.

We understand that LLMs may appear to help for contributions but they often don't provide good enough results to pass the threshold of expectations.

@anushkasingh-commits
Copy link
Contributor Author

Thanks for the feedback. I understand, and I appreciate you taking the time to review this. I’ll improve my approach in future contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: docs Related to the documentation area: router

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs(router): router.navigate() method does not explain some usages

3 participants