Title: docs: Router - tell us to remove `pathMatch: 'full'` from lazy-routing modules · Issue #23900 · angular/angular · GitHub
Open Graph Title: docs: Router - tell us to remove `pathMatch: 'full'` from lazy-routing modules · Issue #23900 · angular/angular
X Title: docs: Router - tell us to remove `pathMatch: 'full'` from lazy-routing modules · Issue #23900 · angular/angular
Description: I stumbled badly in child route configuration because the Router guide didn’t tell me to remove pathMatch: 'full' from lazy loaded routes! See what I mean in “CrisisCenter” route configuration: https://angular.io/guide/router#candeactiva...
Open Graph Description: I stumbled badly in child route configuration because the Router guide didn’t tell me to remove pathMatch: 'full' from lazy loaded routes! See what I mean in “CrisisCenter” route configuration: htt...
X Description: I stumbled badly in child route configuration because the Router guide didn’t tell me to remove pathMatch: 'full' from lazy loaded routes! See what I mean in “CrisisCenter” route configurat...
Opengraph URL: https://github.com/angular/angular/issues/23900
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"docs: Router - tell us to remove `pathMatch: 'full'` from lazy-routing modules","articleBody":"I stumbled badly in child route configuration because the **Router guide** didn’t tell me to remove `pathMatch: 'full'` _from lazy loaded routes!_\r\n\r\nSee what I mean in “CrisisCenter” route configuration:\r\n\r\n1. https://angular.io/guide/router#candeactivate-handling-unsaved-changes\r\n\r\n2. Then search for `pathMatch` and you will end up here:\r\n\r\n```\r\nconst crisisCenterRoutes: Routes = [\r\n {\r\n path: '',\r\n redirectTo: '/crisis-center',\r\n pathMatch: 'full'\r\n },\r\n {\r\n path: 'crisis-center',\r\n component: CrisisCenterComponent,\r\n children: [\r\n {\r\n path: '',\r\n component: CrisisListComponent,\r\n children: [\r\n // ... more\r\n ]\r\n }\r\n ]\r\n }\r\n];\r\n```\r\nI followed that pattern in my app. But because my module lazy loads, only the empty child path matched. The `:id` route did not match and was reported as an error. The router event trace tells me it isn’t matching but not why.\r\n\r\nLater in the Router Guide, we talk a bit about configuration but we don’t talk about `pathMatch`. It just *silently disappears* from the [lazy load configuration](\r\nhttps://angular.io/guide/router#lazy-load-the-crisis-center).\r\n\r\nWe should call out how important it is to remove `pathMatch` from lazy-configured routes!","author":{"url":"https://github.com/wardbell","@type":"Person","name":"wardbell"},"datePublished":"2018-05-14T16:26:04Z","url":"https://github.com/angular/angular/issues/23900"}
| 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:7468e8e6-8c82-2fac-3811-e06c2a0f87b9 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C902:10531B:84E3D7:A9661E:6B012332 |
| html-safe-nonce | fe092664e997fdd4fb92c9512e539139eacd11346ec97c31d4c46b32b04af60e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDOTAyOjEwNTMxQjo4NEUzRDc6QTk2NjFFOjZCMDEyMzMyIiwidmlzaXRvcl9pZCI6IjMyMjEzMDE2NzA4MTAwMzQ5OTQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | e377344e3bee79747e453d1c0300fb96da40a5600671c898e8758511d70660cf |
| hovercard-subject-tag | issue:322889418 |
| 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/23900/issue_layout |
| twitter:image | https://opengraph.githubassets.com/07b9d9683b7e902f74910efe060cdd56a3f1543a86283897436b21dc19917061/angular/angular/issues/23900 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/07b9d9683b7e902f74910efe060cdd56a3f1543a86283897436b21dc19917061/angular/angular/issues/23900 |
| og:image:alt | I stumbled badly in child route configuration because the Router guide didn’t tell me to remove pathMatch: 'full' from lazy loaded routes! See what I mean in “CrisisCenter” route configuration: htt... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | wardbell |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| 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 | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width