-
Notifications
You must be signed in to change notification settings - Fork 27.3k
UrlMatcher as a service #17145
Copy link
Copy link
Closed
Labels
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentAn issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: routerfeatureLabel used to distinguish feature request from other issuesLabel used to distinguish feature request from other issuesfeature: under considerationFeature request for which voting has completed and the request is now under considerationFeature request for which voting has completed and the request is now under consideration
Milestone
Metadata
Metadata
Assignees
Labels
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentAn issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: routerfeatureLabel used to distinguish feature request from other issuesLabel used to distinguish feature request from other issuesfeature: under considerationFeature request for which voting has completed and the request is now under considerationFeature request for which voting has completed and the request is now under consideration
I'm submitting a ... (check one with "x")
Current behavior
Only a function can be set as the
urlMatcherof a route.Expected behavior
A DI-resolved service or function can be set as the
urlMatcherallowing for further injection. I'd expect this to work in an identical way to how the resolver properties can either be services that implement theResolve<T>interface OR can be an inlineresolve()function.Minimal reproduction of the problem with instructions
N/A
What is the motivation / use case for changing the behavior?
My use case is that
InterruptComponentshould resolve if some system state (managed by a service) is currently true. If not, I want to skip this route an let other routes attempt matching. In my case I want to greedily consume the entire sub-path and display a specific component, but only in certain circumstances.Please tell us about your environment:
N/A