Skip to content

fix: add wildcard route with redirect to root#72

Open
corvid-agent wants to merge 1 commit intomainfrom
fix/wildcard-route
Open

fix: add wildcard route with redirect to root#72
corvid-agent wants to merge 1 commit intomainfrom
fix/wildcard-route

Conversation

@corvid-agent
Copy link
Owner

Summary

  • Add catch-all ** route inside ShellComponent children that redirects unknown URLs to the welcome page
  • Add 2 route-config unit tests verifying the wildcard route exists and is positioned last

Fixes #71

Test plan

  • ng test --no-watch passes (385 tests, 18 files)
  • npx tsc --noEmit passes
  • Manual: navigate to /nonexistent — should redirect to welcome page

🤖 Generated with Claude Code

Navigating to an unknown URL (e.g., /nonexistent) showed an empty outlet
with no user feedback. Add a catch-all ** route inside ShellComponent's
children that redirects to the welcome page.

Adds 2 route-config tests verifying the wildcard exists and is last.

Fixes #71

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@corvid-agent
Copy link
Owner Author

Review: LGTM

Clean, minimal change. The wildcard route with redirectTo: '' is the standard Angular pattern for gracefully handling unknown paths. Good that it's placed last in the children array (Angular evaluates routes in order).

The two route-level tests verify both the redirect target and the positioning — straightforward and sufficient. Ready to merge.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: add wildcard route with redirect to root

1 participant