René's URL Explorer Experiment


Title: Consider populating the router.config…children array the same for static and lazy loaded routes · Issue #40010 · angular/angular · GitHub

Open Graph Title: Consider populating the router.config…children array the same for static and lazy loaded routes · Issue #40010 · angular/angular

X Title: Consider populating the router.config…children array the same for static and lazy loaded routes · Issue #40010 · angular/angular

Description: 🚀 feature request Relevant Package This feature request is for @angular/router Description Consider populating the router.config…children array the same for static and lazy loaded routes. Describe the solution you'd like Some developers ...

Open Graph Description: 🚀 feature request Relevant Package This feature request is for @angular/router Description Consider populating the router.config…children array the same for static and lazy loaded routes. Describe ...

X Description: 🚀 feature request Relevant Package This feature request is for @angular/router Description Consider populating the router.config…children array the same for static and lazy loaded routes. Describe ...

Opengraph URL: https://github.com/angular/angular/issues/40010

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Consider populating the router.config…children array the same for static and lazy loaded routes","articleBody":"# 🚀 feature request\r\n\r\n### Relevant Package\r\nThis feature request is for @angular/router\r\n\r\n### Description\r\nConsider populating the router.config…children array the same for static and lazy loaded routes.\r\n\r\n### Describe the solution you'd like\r\n\r\nSome developers including myself like to create navigation elements, say for a header component, directly from the router.confg. Everything is already populated in the router config (including custom data and access via a RouteGuard). When using static routes I would normally do something like the following.\r\n\r\n```\r\n    this.items = this.router.config\r\n      .find((route: Route) => {\r\n        return route.path === this.routePath\r\n      })\r\n      ?.children\r\n      .filter((route: Route) => {\r\n        return route.data != null \r\n      })\r\n      .map((route: Route, index) => {\r\n        return {\r\n          path: \"/\" + this.routePath + \"/\" + route.path,\r\n          icon: route.data.icon,\r\n          label: route.data.label\r\n        }\r\n      });\r\n```\r\n\r\nThe code above simply creates an object array called items for the children of a specific route. I am not showing all the detail but just focusing on the children array because these are static routes. The object returned can be anything the developer needs. \r\n\r\nNow when using lazy loaded routes the children array is not available because the routing data is stored in lazy loaded modules that have not been loaded yet. Several people have tried to use the private _loadedConfig property on a route but it gets ugly and you end up with something like this.\r\n\r\n```\r\n    this.buttons = (this.router.config\r\n      .find((route: Route) => {\r\n        return route.path === this.routePath\r\n      }) as any)\r\n      ?._loadedConfig\r\n      ?.routes[0]\r\n      ?.children\r\n      .filter((route: Route) => {\r\n        return route.data != null \r\n      })\r\n      .map((route: Route, index: number) => {\r\n        return {\r\n          path: \"/\" + this.routePath + \"/\" + route.path,\r\n          icon: route.data.icon,\r\n          label: route.data.label,\r\n        }\r\n      })\r\n```\r\n\r\nWhile this works its not ideal. The obvious issue is that the private _loadedConfig is subject to change without warning in the future because its not part of the public API and this object is not available until some point in the lifecycle that I have not been able to determine yet. \r\n\r\nNow the data that is eventually available in the _loadedConfig is exactly what developers are interested in (path, data, etc.) and it seems to be available even before the lazy modules are loaded. Given this would it be possible to present this information using the normal children array regardless if it’s a static route or a lazy loaded route? In most scenarios developers only care to have access to the route children and its less important that it’s from a static route vs. a lazy loaded route. A Boolean or enumeration could be added that would let the developer know the route static vs lazy if that is important. \r\n\r\nThis would mean any code designed to work with the router, config, and children would work with static or lazy loaded routes. The project could start with standard static routes and then later be reconfigured to use lazy routes and any code already in place that leverages the router config would continue to work.\r\n\r\nOne additional thought would be at webpack/compile time Angular would have access to all the routes regardless if they are static or lazy. Maybe some metadata can be derived from this and used to populate the routes children information at runtime.\r\n \r\nI know it’s a long shot, but I wanted to suggest the general idea.\r\n\r\nThanks,\r\nEric\r\n\r\n\r\n\r\n\r\n","author":{"url":"https://github.com/epaitz","@type":"Person","name":"epaitz"},"datePublished":"2020-12-07T17:48:49Z","url":"https://github.com/angular/angular/issues/40010"}

react-profiling0
react-import-mapreact,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-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:f6553b59-55a5-2532-aba2-6b46ee6c507d
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idC26E:25A204:E50E47:12E7D6B:6B00FE03
html-safe-nonce2de1257d55fd27ba905f4bbbacb3f00cfe19e5b5c845d095bb9956300d1ef1c4
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMjZFOjI1QTIwNDpFNTBFNDc6MTJFN0Q2Qjo2QjAwRkUwMyIsInZpc2l0b3JfaWQiOiI4MjEyODQ0NDY2NzMwNDk5NTg4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacbb1f676bf6b91cb8290cd842f3fe7b06d76bbf6810159578dcd644e84a56c4dd
hovercard-subject-tagissue:758715620
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular/40010/issue_layout
twitter:imagehttps://opengraph.githubassets.com/06fc76e0db5d743a32affe7ca003b8f3a5123164658f0f340f4167d63ced4bd5/angular/angular/issues/40010
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/06fc76e0db5d743a32affe7ca003b8f3a5123164658f0f340f4167d63ced4bd5/angular/angular/issues/40010
og:image:alt🚀 feature request Relevant Package This feature request is for @angular/router Description Consider populating the router.config…children array the same for static and lazy loaded routes. Describe ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameepaitz
hostnamegithub.com
expected-hostnamegithub.com
Nonee208d86428ec00a57ade75058166297440e8128a01e5287c31a53dc042bbf187
turbo-cache-controlno-preview
go-importgithub.com/angular/angular git https://github.com/angular/angular.git
octolytics-dimension-user_id139426
octolytics-dimension-user_loginangular
octolytics-dimension-repository_id24195339
octolytics-dimension-repository_nwoangular/angular
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id24195339
octolytics-dimension-repository_network_root_nwoangular/angular
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release7dafd017fb7809a839c443dba08622af38e63c09
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/angular/angular/issues/40010#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fissues%2F40010
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fissues%2F40010
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=angular%2Fangular
Reloadhttps://github.com/angular/angular/issues/40010
Reloadhttps://github.com/angular/angular/issues/40010
Reloadhttps://github.com/angular/angular/issues/40010
angularhttps://github.com/angular
angularhttps://github.com/angular/angular
Codehttps://github.com/angular/angular
Issues835 (835)https://github.com/angular/angular/issues
Pull requests141 (141)https://github.com/angular/angular/pulls
Discussionshttps://github.com/angular/angular/discussions
Actionshttps://github.com/angular/angular/actions
Projectshttps://github.com/angular/angular/projects
Security and quality40 (40)https://github.com/angular/angular/security
Insightshttps://github.com/angular/angular/insights
https://github.com/angular/angular
New issuehttps://github.com/login?return_to=https://github.com/angular/angular/issues/40010
New issuehttps://github.com/login?return_to=https://github.com/angular/angular/issues/40010
Consider populating the router.config…children array the same for static and lazy loaded routeshttps://github.com/angular/angular/issues/40010#top
area: routerhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20router%22
featureLabel used to distinguish feature request from other issueshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22feature%22
feature: under considerationFeature request for which voting has completed and the request is now under considerationhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22feature%3A%20under%20consideration%22
router: lazy loadinghttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22router%3A%20lazy%20loading%22
Backloghttps://github.com/angular/angular/milestone/82
https://github.com/epaitz
epaitzhttps://github.com/epaitz
on Dec 7, 2020https://github.com/angular/angular/issues/40010#issue-758715620
sonukapoorhttps://github.com/sonukapoor
area: routerhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20router%22
router: lazy loadinghttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22router%3A%20lazy%20loading%22
on Dec 8, 2020https://github.com/angular/angular/issues/40010#event-4082803849
ngbothttps://github.com/apps/ngbot
needsTriagehttps://github.com/angular/angular/milestone/83
on Dec 8, 2020https://github.com/angular/angular/issues/40010#event-4082803882
atscotthttps://github.com/atscott
featureLabel used to distinguish feature request from other issueshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22feature%22
on Dec 8, 2020https://github.com/angular/angular/issues/40010#event-4086896830
ngbothttps://github.com/apps/ngbot
needsTriagehttps://github.com/angular/angular/milestone/83
Backloghttps://github.com/angular/angular/milestone/82
on Dec 8, 2020https://github.com/angular/angular/issues/40010#event-4086896885
angular-robothttps://github.com/apps/angular-robot
votes requiredhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22votes%20required%22
on Jun 4, 2021https://github.com/angular/angular/issues/40010#event-4843689455
https://github.com/apps/angular-robot
angular-robothttps://github.com/apps/angular-robot
on Jun 4, 2021https://github.com/angular/angular/issues/40010#issuecomment-854794804
documentationhttps://github.com/angular/angular/blob/e29eb8abfbfdfb793e08ac88e14b7ba6d2ff2136/docs/GITHUB_PROCESS.md#feature-request-process
https://github.com/apps/angular-robot
angular-robothttps://github.com/apps/angular-robot
on Jun 25, 2021https://github.com/angular/angular/issues/40010#issuecomment-868528187
communityhttps://angular.io/resources?category=community
packagehttps://angular.io/guide/creating-libraries
documentationhttps://github.com/angular/angular/blob/e29eb8abfbfdfb793e08ac88e14b7ba6d2ff2136/docs/GITHUB_PROCESS.md#feature-request-process
angular-robothttps://github.com/apps/angular-robot
insufficient voteshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22insufficient%20votes%22
on Jun 25, 2021https://github.com/angular/angular/issues/40010#event-4940276537
https://github.com/SchnWalter
SchnWalterhttps://github.com/SchnWalter
on Jul 2, 2021https://github.com/angular/angular/issues/40010#issuecomment-873247060
ExtraOptions.initialNavigationhttps://angular.io/api/router/ExtraOptions#initialNavigation
Router.initialNavigation()https://angular.io/api/router/Router#initialNavigation
jessicajaniukhttps://github.com/jessicajaniuk
feature: under considerationFeature request for which voting has completed and the request is now under considerationhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22feature%3A%20under%20consideration%22
insufficient voteshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22insufficient%20votes%22
on Oct 3, 2022https://github.com/angular/angular/issues/40010#event-7509328768
https://github.com/vickyRathee
vickyRatheehttps://github.com/vickyRathee
on Nov 20, 2022https://github.com/angular/angular/issues/40010#issuecomment-1321116873
@SchnWalterhttps://github.com/SchnWalter
dayschedule.comhttps://dayschedule.com/
https://user-images.githubusercontent.com/6106479/202900956-079e514e-b81c-45a0-a3f0-5c79f9797ad6.png
https://user-images.githubusercontent.com/6106479/202901025-b9f12284-f4cf-4c76-b84c-91cd4fffaa8f.png
https://github.com/muuvmuuv
muuvmuuvhttps://github.com/muuvmuuv
on May 8, 2025https://github.com/angular/angular/issues/40010#issuecomment-2862056313
https://github.com/muuvmuuv/angular-router-menushttps://github.com/muuvmuuv/angular-router-menus
@vickyRatheehttps://github.com/vickyRathee
#61192https://github.com/angular/angular/issues/61192
JeanMechehttps://github.com/JeanMeche
feature: votes requiredhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22feature%3A%20votes%20required%22
on Oct 1, 2025https://github.com/angular/angular/issues/40010#event-20030912386
Sign up for freehttps://github.com/signup?return_to=https://github.com/angular/angular/issues/40010
Sign in to commenthttps://github.com/login?return_to=https://github.com/angular/angular/issues/40010
area: routerhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20router%22
featureLabel used to distinguish feature request from other issueshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22feature%22
feature: under considerationFeature request for which voting has completed and the request is now under considerationhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22feature%3A%20under%20consideration%22
router: lazy loadinghttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22router%3A%20lazy%20loading%22
BacklogNo due datehttps://github.com/angular/angular/milestone/82
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.