Which @angular/* package(s) are relevant/related to the feature request?
No response
Description
Problem
Angular Router currently supports ** only as a catch-all at the end of a route. It lacks support for multi-segment wildcards between fixed segments—e.g., /foo/**/bar should match /foo/a/bar, /foo/a/b/c/bar, but not /foo/bar.
The only workaround today is a custom UrlMatcher, which introduces unnecessary complexity, boilerplate, and testing burden for a common pattern.
Proposal
Component Access
Intermediate segments could be exposed via ActivatedRoute, e.g.:
const segments = route.snapshot.paramMap.get('wildcardSegments');
Allow ** to be used between segments in the path property:
{ path: 'foo/**/bar', component: MyComponent }
Matching rules:
- Must start with
foo, end with bar
- Must include one or more intermediate segments
Examples:
- ✅
/foo/a/bar, /foo/a/b/c/bar
- ❌
/foo/bar, /foo/a/b/baz
Benefits
- Declarative, readable routing for hierarchical paths
- Avoids verbose
UrlMatcher implementations
- Improves DX, reduces boilerplate, aids tooling and static analysis
Related:
Which @angular/* package(s) are relevant/related to the feature request?
No response
Description
Problem
Angular Router currently supports
**only as a catch-all at the end of a route. It lacks support for multi-segment wildcards between fixed segments—e.g.,/foo/**/barshould match/foo/a/bar,/foo/a/b/c/bar, but not/foo/bar.The only workaround today is a custom
UrlMatcher, which introduces unnecessary complexity, boilerplate, and testing burden for a common pattern.Proposal
Component Access
Intermediate segments could be exposed via
ActivatedRoute, e.g.:Allow
**to be used between segments in thepathproperty:Matching rules:
foo, end withbarExamples:
/foo/a/bar,/foo/a/b/c/bar/foo/bar,/foo/a/b/bazBenefits
UrlMatcherimplementationsRelated:
CommonEngineSSR App crashing in 19.1 whenUrlMatcheris used angular-cli#29420urlMatcherin route config are breaking due to commit 6edb908 angular-cli#29384