Title: Add canUse guard · Issue #14515 · angular/angular · GitHub
Open Graph Title: Add canUse guard · Issue #14515 · angular/angular
X Title: Add canUse guard · Issue #14515 · 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/14515
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add canUse guard","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\nCurrently we have two main types of guards:\n\n* `CanLoad`: decides if we can load a module (used with lazy loading)\n* `CanActivate` and friends. It decides if we can activate/deactivate a route.\n\nSo we always decide where we want to navigate first (\"recognize\") and create a new router state snapshot. And only then we run guards to check if the navigation should be allowed. \n\nThis doesn't handle one very important use case where we want to decide where to navigate based on some data (e.g., who the user is).\n\nI suggest to add a new guard that allows us to do that.\n\n```\n[\n {path: 'home', component: AdminHomePage, canUse: [IsAdmin]},\n {path: 'home', component: SimpleHomePage}\n]\n```\n\nHere, navigating to '/home' will render `AdminHomePage' if the user is an admin and will render 'SimpleHomePage' otherwise. Note that the url will remain '/home'.\n\n## Implementation Notes\n\n* This should be handled in both applyRedirects and recognize.","author":{"url":"https://github.com/vsavkin","@type":"Person","name":"vsavkin"},"datePublished":"2017-02-15T20:25:50Z","url":"https://github.com/angular/angular/issues/14515"}
| 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:4179c2d2-197e-9b84-5013-1fdd296ca25d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8100:DB09F:7C48BA:9FFA46:6B00E815 |
| html-safe-nonce | f6201f77b895230798fd28c1f215544aacb626f7c35d5f008d74b521ac6620b3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MTAwOkRCMDlGOjdDNDhCQTo5RkZBNDY6NkIwMEU4MTUiLCJ2aXNpdG9yX2lkIjoiOTE1ODEyNDEzNjczNDcxMzg3NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | e0ddc503893be56950e465d71ec5453d2f88cd4ccb50bc4460b65dcf7c665222 |
| hovercard-subject-tag | issue:207917978 |
| 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/14515/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8241ecb1559ae4ad8774d6e50051e86cd01c5a8fba1142600c8fa2b3ed0bcae6/angular/angular/issues/14515 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8241ecb1559ae4ad8774d6e50051e86cd01c5a8fba1142600c8fa2b3ed0bcae6/angular/angular/issues/14515 |
| 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 | vsavkin |
| hostname | github.com |
| expected-hostname | github.com |
| None | 27088b6977484d0d3321d9a11c907c6d6637b315cfa359ef7952dbf6292f9b14 |
| 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 | 624179fb8b88d26ba5bba08894eb60a1c5a1d93d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width