Title: bug(router) aux-routes not working with empty-path top-level routes · Issue #10726 · angular/angular · GitHub
Open Graph Title: bug(router) aux-routes not working with empty-path top-level routes · Issue #10726 · angular/angular
X Title: bug(router) aux-routes not working with empty-path top-level routes · Issue #10726 · angular/angular
Description: I'm submitting a ... (check one with "x") [x] bug report [ ] feature request [ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question Current be...
Open Graph Description: I'm submitting a ... (check one with "x") [x] bug report [ ] feature request [ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/ma...
X Description: I'm submitting a ... (check one with "x") [x] bug report [ ] feature request [ ] support request => Please do not submit support request here, instead see https://github.com/angula...
Opengraph URL: https://github.com/angular/angular/issues/10726
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"bug(router) aux-routes not working with empty-path top-level routes","articleBody":"**I'm submitting a ...** (check one with \"x\")\n\n```\n[x] bug report\n[ ] feature request\n[ ] support request =\u003e 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\nAux-Routes are not found when using two levels of \"default routes\" (with `path:''`).\nThis config works:\n\n``` ts\n RouterModule.forRoot([\n {\n path: 'tasks', component: TasksComponent, //container-component has two outlets! \n children: [\n { path: '', component:TaskListComponent },\n { path: 'overview/:id', component: TasksComponent, outlet: 'right' },\n ]\n }\n ],\n```\n\nI can open the Tasks-overview by doing:\n\n`http://localhost:4200/tasks/(right:overview/3)`\n\nSee this plnkr and click \"to list\", \"open aux\"\n\nAs I want to extract the whole Tasks-Functionality into a `TasksModule` I need to be able to do something like this:\n\n``` ts\n RouterModule.forRoot([\n {\n path: 'tasks', : children: [ // this one would be in main module\n //this is defined in the TasksModule:\n { path: '', component: TasksComponent, //container-component has two outlets! \n children: [\n { path: '', component:TaskListComponent },\n { path: 'overview/:id', component: TasksComponent, outlet: 'right' },\n ]\n }\n ],\n```\n\nI would assume both configs are equivalent, and all of the \"normal\" routing works perfectly fine. But now the link above `http://localhost:4200/tasks/(right:overview/3)` leads to:\n\n`Uncaught (in promise): Error: Cannot match any routes: 'tasks'`\n\nSee this plnkr: http://plnkr.co/edit/xd77Mkpqfq6U9tKM4USU?p=preview\n\n**Expected/desired behavior**\n\nAux-Routes should also work with empty-path parents\n\n**Reproduction of the problem**\n\nWorking version: http://plnkr.co/edit/Twx4hXQ0TLfHfrYSe4MO?p=preview\nNon-working version: http://plnkr.co/edit/xd77Mkpqfq6U9tKM4USU?p=preview\n\n**What is the expected behavior?**\n\nBoth versions of route definition should lead to the same behavior\n\n**What is the motivation / use case for changing the behavior?**\n\nWith the current implementation it is impossible to create an encapsulated Config / Module for the tasks behaviour and include it under a certain path into the main config e.g. \"myTasks\". \n\n/cc @vsavkin \n\n**Please tell us about your environment:**\n- **Angular version:** 2.0.0-rc.5\n- **Browser:** [all ] \n- **Language:** [TS ]","author":{"url":"https://github.com/choeller","@type":"Person","name":"choeller"},"datePublished":"2016-08-12T09:07:18.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":46},"url":"https://github.com/10726/angular/issues/10726"}
| 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:97ef19d9-f8d7-47df-9873-1a47d47ea900 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 95E0:21D0B9:5BA270:77356C:6A5FF92A |
| html-safe-nonce | c85b20537f4ec3bc7db2d895a9ed65a434452f8de39140ec5fead15f2b6edfa7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NUUwOjIxRDBCOTo1QkEyNzA6NzczNTZDOjZBNUZGOTJBIiwidmlzaXRvcl9pZCI6IjI3NjIxOTc3NDMwNTgyODY4OTAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 015353248be35e5eda04150297f7ec945a43d030fed107a80849431cb233b9d4 |
| hovercard-subject-tag | issue:170828994 |
| 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/10726/issue_layout |
| twitter:image | https://opengraph.githubassets.com/beeaae5d3123351965466202183cf8e295712a866c935a1ba1719d181c35c58d/angular/angular/issues/10726 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/beeaae5d3123351965466202183cf8e295712a866c935a1ba1719d181c35c58d/angular/angular/issues/10726 |
| og:image:alt | I'm submitting a ... (check one with "x") [x] bug report [ ] feature request [ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/ma... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | choeller |
| hostname | github.com |
| expected-hostname | github.com |
| None | 79522f2cee5c5409f33a714312a1a68d41ad77a807626020d980fb1eb81def07 |
| 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 | 3df4fbea9b6b5ead5c6724a99dc5f5b62caa864b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width