Title: Allow CanActivate[Child] Guards to be "blocking" · Issue #12627 · angular/angular · GitHub
Open Graph Title: Allow CanActivate[Child] Guards to be "blocking" · Issue #12627 · angular/angular
X Title: Allow CanActivate[Child] Guards to be "blocking" · Issue #12627 · angular/angular
Description: I'm submitting a ... (check one with "x") [ ] bug report => search github for a similar issue or PR before submitting [x] feature request [ ] support request => Please do not submit support request here, instead see https://github.com/an...
Open Graph Description: I'm submitting a ... (check one with "x") [ ] bug report => search github for a similar issue or PR before submitting [x] feature request [ ] support request => Please do not submit support request...
X Description: I'm submitting a ... (check one with "x") [ ] bug report => search github for a similar issue or PR before submitting [x] feature request [ ] support request => Please do not su...
Opengraph URL: https://github.com/angular/angular/issues/12627
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Allow CanActivate[Child] Guards to be \"blocking\"","articleBody":"**I'm submitting a ...** (check one with \"x\")\n```\n[ ] bug report => search github for a similar issue or PR before submitting\n[x] feature request\n[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question\n```\n\n**Current behavior**\nCanActivate[Child] Guards run, parent-first, in parallel, meaning there is no way to resolve data in a parent that may be needed in child guards, unless managed explicitly elsewhere.\n\n**Expected behavior**\nA CanActivate[Child] guard's behavior could possibly be set to block children guards from.\n\n**Minimal reproduction of the problem with instructions**\n```javascript\n{\n path: 'parent',\n canActivateChild: [FiveSecondObservableGuard], // Takes a long time\n children: [\n {\n path: 'child',\n component: ChildComponent, // waits a long time, as expected\n canActivate: [AuthGuard] // Runs immediately\n }\n]\n}\n```\n\n**What is the motivation / use case for changing the behavior?**\nLoading server information/flags that are required in all Guards can now be done in two ways:\n- in `APP_INITIALIZER`, which severely hinders UX choices/flexibility\n- Making all requests for server data asynchronous, making the whole codebase needlessly complex.\n\nWhen a certain branch of routes is behind an AuthGuard that may need asynchronous loading, while the components respect the Guard the Guards themselves (which may require user identification to be complete) won't necessarily have access to that (unless all data is made asynchronous, as mentioned above)\n\n* **Angular version:** 2.0.X\n\n* **Browser:** all\n \n* **Language:** all","author":{"url":"https://github.com/tiagoroldao","@type":"Person","name":"tiagoroldao"},"datePublished":"2016-10-31T12:03:38Z","url":"https://github.com/angular/angular/issues/12627"}
| 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:b4c594d2-8c6b-f27f-9dc9-f61f70abcc5b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B562:65478:D3527C:119FFBB:6B00FD31 |
| html-safe-nonce | e9b52edc08fa7ca28917fe11ab91ca652191aae6a653128bb35d7861f98b576f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNTYyOjY1NDc4OkQzNTI3QzoxMTlGRkJCOjZCMDBGRDMxIiwidmlzaXRvcl9pZCI6IjE4MjY5OTY1MTQ0NzIzOTQwMzMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 730ff213589293d63c6b48f00853dc979bcd4620235770dac588e1c285184bd9 |
| hovercard-subject-tag | issue:186267482 |
| 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/12627/issue_layout |
| twitter:image | https://opengraph.githubassets.com/265f8519b18f7cd5ee18e3746887b2383e30ec0e551670799d56847b70a364fd/angular/angular/issues/12627 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/265f8519b18f7cd5ee18e3746887b2383e30ec0e551670799d56847b70a364fd/angular/angular/issues/12627 |
| og:image:alt | I'm submitting a ... (check one with "x") [ ] bug report => search github for a similar issue or PR before submitting [x] feature request [ ] support request => Please do not submit support request... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | tiagoroldao |
| 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