Title: Make resolves/guards injectable/gettable in other resolves/guards on the same level · Issue #15032 · angular/angular · GitHub
Open Graph Title: Make resolves/guards injectable/gettable in other resolves/guards on the same level · Issue #15032 · angular/angular
X Title: Make resolves/guards injectable/gettable in other resolves/guards on the same level · Issue #15032 · 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/15032
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Make resolves/guards injectable/gettable in other resolves/guards on the same level","articleBody":"\u003c!--\nIF YOU DON'T FILL OUT THE FOLLOWING INFORMATION WE MIGHT CLOSE YOUR ISSUE WITHOUT INVESTIGATING\n-->\n\n**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**\n\u003c!-- Describe how the bug manifests. -->\nIn a resolve, we are able to get the data from resolves on the parents, but not from the same level, so we need to do:\n```typescript\n[\n {\n canActivate: [PlannerForGuard],\n canActivateChild: [PlannerForGuard],\n children: [\n {\n canActivateChild: [PlannerForGuard],\n children: [\n {\n canActivate: [RedirectToLastRunGuard],\n canActivateChild: [PlannerForGuard],\n children: [\n {\n component: RunsComponent,\n path: 'runs/:runId',\n resolve: {\n deleteRun: DeleteRunResolve,\n run: RunResolve\n }\n },\n {\n canActivate: [RedirectToLastRunGuard],\n component: RunsComponent,\n path: 'runs'\n }\n ],\n component: SimulationComponent,\n path: '',\n resolve: {\n createRun: CreateRunResolve,\n createSimulation: CreateSimulationResolve,\n deleteSimulation: DeleteSimulationResolve\n }\n }\n ],\n path: '',\n resolve: {\n runs: RunsResolve\n }\n }\n ],\n path: '',\n resolve: {\n simulation: SimulationResolve\n }\n }\n ]\n```\n\n**Expected behavior**\n\u003c!-- Describe what the behavior would be without the bug. -->\nThis could be so much simplified if resolves/guards can 'wait' for other resolves/guards on the same level, like this (it will also make for less guard checks....):\n```typescript\n[\n {\n canActivate: [PlannerForGuard, RedirectToLastRunGuard],\n canActivateChild: [PlannerForGuard],\n children: [\n {\n component: RunsComponent,\n path: 'runs/:runId',\n resolve: {\n deleteRun: DeleteRunResolve,\n run: RunResolve\n }\n },\n {\n canActivate: [RedirectToLastRunGuard],\n component: RunsComponent,\n path: 'runs'\n }\n ],\n component: SimulationComponent,\n path: '',\n resolve: {\n createRun: CreateRunResolve,\n createSimulation: CreateSimulationResolve,\n deleteSimulation: DeleteSimulationResolve,\n runs: RunsResolve,\n simulation: SimulationResolve\n }\n }\n]\n```\n\n**What is the motivation / use case for changing the behavior?**\n\u003c!-- Describe the motivation or the concrete use case -->\nIt would allow for less, clearer code + less runs of guards + speed up resolving resolves (as it's now done per level) + no more .parent.parent..... to get the parent resolves (or a custom function to search for a resolve by name ;))","author":{"url":"https://github.com/dietergeerts","@type":"Person","name":"dietergeerts"},"datePublished":"2017-03-09T11:18:43Z","url":"https://github.com/angular/angular/issues/15032"}
| 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:0528e238-6738-e3e5-c9ab-cb247e4fc080 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E684:154D88:97330:C0B8D:6B00F5FD |
| html-safe-nonce | e3b115e5e3f3903a40b3553dde8012a446b481947dd348e15686c06b0a2c0288 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNjg0OjE1NEQ4ODo5NzMzMDpDMEI4RDo2QjAwRjVGRCIsInZpc2l0b3JfaWQiOiIxMzA2ODE3MjExMTg0MjQ4MzE3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 872c3b0325cedb7b7cf7e46644efca80b597e8e46caf6cc54e648e2833e9d558 |
| hovercard-subject-tag | issue:213007182 |
| 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/15032/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d348a73afbe6042769db75a02fce2d182eb48093b6ca89e43410bcb5e80b57b8/angular/angular/issues/15032 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d348a73afbe6042769db75a02fce2d182eb48093b6ca89e43410bcb5e80b57b8/angular/angular/issues/15032 |
| 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 | dietergeerts |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4ef498cbabcbe3c50befc7a5b743e7072ee770b4daf0e15e54801180d1fa91fc |
| 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 | 9983dd5da06943f833c971dd5b6bc988e2858be5 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width