Title: [Router] Add defaultUrlMatcher to public API · Issue #35928 · angular/angular · GitHub
Open Graph Title: [Router] Add defaultUrlMatcher to public API · Issue #35928 · angular/angular
X Title: [Router] Add defaultUrlMatcher to public API · Issue #35928 · angular/angular
Description: 🚀 feature request Relevant Package This feature request is for @angular/router Description There should be ability to access defaultUrlMatcher from user's code. Ability to access and use it in custom implementations of UrlMatcher will ea...
Open Graph Description: 🚀 feature request Relevant Package This feature request is for @angular/router Description There should be ability to access defaultUrlMatcher from user's code. Ability to access and use it in cust...
X Description: 🚀 feature request Relevant Package This feature request is for @angular/router Description There should be ability to access defaultUrlMatcher from user's code. Ability to access and use it in ...
Opengraph URL: https://github.com/angular/angular/issues/35928
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Router] Add defaultUrlMatcher to public API","articleBody":"\u003c!--🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅\r\n\r\nOh hi there! 😄 \r\n\r\nTo expedite issue processing please search open and closed issues before submitting a new one.\r\nExisting issues often contain information about workarounds, resolution, or progress updates.\r\n\r\n🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅-->\r\n\r\n\r\n# 🚀 feature request\r\n\r\n### Relevant Package\r\n\u003c!-- Can you pin-point one or more @angular/* packages the are relevant for this feature request? -->\r\nThis feature request is for @angular/router\r\n\r\n\r\n### Description\r\nThere should be ability to access defaultUrlMatcher from user's code.\r\nAbility to access and use it in custom implementations of UrlMatcher will ease developing of custom url matchers like in this question:\r\nhttps://stackoverflow.com/a/41543827/5358442\r\n```ts\r\nfunction digitsMatcher(segments: UrlSegment[], segmentGroup: UrlSegmentGroup, route: Route): UrlMatchResult | null {\r\n const result = defaultUrlMatcher(segments, segmentGroup, route);\r\n\r\n if (!result || !result.consumed || result.consumed.length \u003c 1) {\r\n return;\r\n }\r\n\r\n const re = /^\\d+$/;\r\n const match = re.exec(result.consumed[0].path);\r\n\r\n if (match) {\r\n return result;\r\n }\r\n\r\n return null;\r\n}\r\n```\r\n\r\n### Describe the solution you'd like\r\nThere should be ability to import default URL matcher and call it from user-defined custom matcher.\r\n\r\n### Describe alternatives you've considered\r\nAnother solution of \"my\" case can be adding support of constraints for route params with few built-in constraints like Integer and Regex and ability to create custom constraints. \r\nThis could look something like this:\r\n```ts\r\nconst routes: Routes = [\r\n { path: ':clientId/:lang', component: ClientOpenComponent,\r\n constraints: { \r\n clientId: [RouteParamConstraints.Integer], /*built-in*/\r\n lang: [LangRouterParamConstraint] } /*custom*/\r\n}];\r\n```\r\n","author":{"url":"https://github.com/RoboBurned","@type":"Person","name":"RoboBurned"},"datePublished":"2020-03-07T08:45:49Z","url":"https://github.com/angular/angular/issues/35928"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:581d40c2-fbd5-8609-67a9-fb0d44434459 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AD16:1DCB8C:DE487A:126FC22:6B00FCA0 |
| html-safe-nonce | 7bcdc1336c0edb1db6fc56e7ccb702e4281d7a0edb55244ff3bd810781f5b4b2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRDE2OjFEQ0I4QzpERTQ4N0E6MTI2RkMyMjo2QjAwRkNBMCIsInZpc2l0b3JfaWQiOiI3Njk2MjA0NjQ1OTkwOTg4OTYwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 7b1b40de3c36262cb0749e43012d267f60fd875da08558df105091e902cb082e |
| hovercard-subject-tag | issue:577302426 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular/35928/issue_layout |
| twitter:image | https://opengraph.githubassets.com/fbae0dfcc6cbaa831005c3cc5040cad48cbcdec365bc2374336c33baa8e6d6ee/angular/angular/issues/35928 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/fbae0dfcc6cbaa831005c3cc5040cad48cbcdec365bc2374336c33baa8e6d6ee/angular/angular/issues/35928 |
| og:image:alt | 🚀 feature request Relevant Package This feature request is for @angular/router Description There should be ability to access defaultUrlMatcher from user's code. Ability to access and use it in cust... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | RoboBurned |
| hostname | github.com |
| expected-hostname | github.com |
| None | e208d86428ec00a57ade75058166297440e8128a01e5287c31a53dc042bbf187 |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular git https://github.com/angular/angular.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 24195339 |
| octolytics-dimension-repository_nwo | angular/angular |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 24195339 |
| octolytics-dimension-repository_network_root_nwo | angular/angular |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7dafd017fb7809a839c443dba08622af38e63c09 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width