Title: Not possible to navigate away from the named outlet · Issue #51373 · angular/angular · GitHub
Open Graph Title: Not possible to navigate away from the named outlet · Issue #51373 · angular/angular
X Title: Not possible to navigate away from the named outlet · Issue #51373 · angular/angular
Description: Which @angular/* package(s) are the source of the bug? router Is this a regression? Yes Description I have an app with complex routing structure where named outlets are used extensively. Accordingly to the official documentation I should...
Open Graph Description: Which @angular/* package(s) are the source of the bug? router Is this a regression? Yes Description I have an app with complex routing structure where named outlets are used extensively. Accordingl...
X Description: Which @angular/* package(s) are the source of the bug? router Is this a regression? Yes Description I have an app with complex routing structure where named outlets are used extensively. Accordingl...
Opengraph URL: https://github.com/angular/angular/issues/51373
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Not possible to navigate away from the named outlet","articleBody":"### Which @angular/* package(s) are the source of the bug?\n\nrouter\n\n### Is this a regression?\n\nYes\n\n### Description\n\nI have an app with complex routing structure where named outlets are used extensively. [Accordingly to the official documentation](https://angular.io/guide/router-tutorial-toh#clear-secondary-routes) I should be able to navigate away from the named outlet by simply null-ying it's navigation path:\r\n\r\n```\r\nclosePopup() {\r\n // Providing a `null` value to the named outlet\r\n // clears the contents of the named outlet\r\n this.router.navigate([{ outlets: { popup: null }}]);\r\n}\r\n```\r\n\r\nUnfortunately this is not possible at all unless I use *a parent route* of a route where named outlet is located.\r\n\r\nMaybe the problem is that a named outlet is used not on the app's root level but inside a lazy-loaded module? Or that the parent of the named outlet has an empty path?\r\n\r\n\r\n\r\n\r\nIf this is expected behavior I would be thankful for an explanation why the code from the official documentations doesn't work in my case and what is going on underneath. Why a parent route is required in this case?\r\n\n\n### Please provide a link to a minimal reproduction of the bug\n\nhttps://github.com/usarskyy/angular-named-outlet-bug\n\n### Please provide the exception or error you saw\n\n_No response_\n\n### Please provide the environment you discovered this bug in (run `ng version`)\n\n```true\nAngular CLI: 15.0.5\r\nNode: 16.13.0\r\nPackage Manager: npm 8.19.0\r\nOS: win32 x64\r\n\r\nAngular: 15.2.9\r\n... animations, common, compiler, compiler-cli, core, forms\r\n... platform-browser, platform-browser-dynamic, router\r\n\r\nPackage Version\r\n---------------------------------------------------------\r\n@angular-devkit/architect 0.1502.9\r\n@angular-devkit/build-angular 15.2.9\r\n@angular-devkit/core 15.2.9\r\n@angular-devkit/schematics 15.0.5\r\n@angular/cli 15.0.5\r\n@schematics/angular 15.0.5\r\nrxjs 7.5.7\r\ntypescript 4.8.4\n```\n\n\n### Anything else?\n\n_No response_","author":{"url":"https://github.com/usarskyy","@type":"Person","name":"usarskyy"},"datePublished":"2023-08-15T17:05:48Z","url":"https://github.com/angular/angular/issues/51373"}
| 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:c58e565b-243c-abba-6bf9-e380164ec126 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DEC6:1148D3:115A795:1631B13:6B011C75 |
| html-safe-nonce | 3b7318ac4bf9cbc27ef71bf131b370beff2422cf6b22268be2c50796bdc7db44 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERUM2OjExNDhEMzoxMTVBNzk1OjE2MzFCMTM6NkIwMTFDNzUiLCJ2aXNpdG9yX2lkIjoiNDIxMTA1NjkxNjg3MDI3NDE2NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 959d9f6a9beb5e536f1f7a764d4cefa7015919d3314b85f05e8d4d9136e9c802 |
| hovercard-subject-tag | issue:1851810955 |
| 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/51373/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a6c7ad70d60e69a4b8399e1e8a54c3928fcffbd5158eae14b8432365ba1279b6/angular/angular/issues/51373 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a6c7ad70d60e69a4b8399e1e8a54c3928fcffbd5158eae14b8432365ba1279b6/angular/angular/issues/51373 |
| og:image:alt | Which @angular/* package(s) are the source of the bug? router Is this a regression? Yes Description I have an app with complex routing structure where named outlets are used extensively. Accordingl... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | usarskyy |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| 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 | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width