Title: Object set as readonly when passed as a route data · Issue #53632 · angular/angular · GitHub
Open Graph Title: Object set as readonly when passed as a route data · Issue #53632 · angular/angular
X Title: Object set as readonly when passed as a route data · Issue #53632 · angular/angular
Description: Which @angular/* package(s) are the source of the bug? router Is this a regression? No Description I have a use case where I pass an environment const as a data for a specific route. And I just remark that after the migration to angular ...
Open Graph Description: Which @angular/* package(s) are the source of the bug? router Is this a regression? No Description I have a use case where I pass an environment const as a data for a specific route. And I just rem...
X Description: Which @angular/* package(s) are the source of the bug? router Is this a regression? No Description I have a use case where I pass an environment const as a data for a specific route. And I just rem...
Opengraph URL: https://github.com/angular/angular/issues/53632
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Object set as readonly when passed as a route data","articleBody":"### Which @angular/* package(s) are the source of the bug?\n\nrouter\n\n### Is this a regression?\n\nNo\n\n### Description\n\nI have a use case where I pass an environment const as a data for a specific route. And I just remark that after the migration to angular 17, this const is set to readonly when the user go to this route. But not when he go to the page with the url.\r\n\r\nAfter some investigations this issue appear with the change of default value for `paramsInheritanceStrategy` (now set as `emptyOnly` by default). For me it's a bug since the behavior is not the same when `paramsInheritanceStrategy: 'always'`. \r\n\r\nTo do my test I just create 2 components with 2 different routes. One of this route use an environment const as data and the other route is here just to mock a navigation.\r\n\r\nFor the minimal reproduction : \r\n Click on comp1\r\n Click on test, an error should be throw in the console\r\n\r\n Refresh the page when on the comp1\r\n Click on test, nothing append\r\n Click on comp2\r\n Click on test, nothing append\r\n Click on comp1\r\n Click on test, an error should be throw in the console\n\n### Please provide a link to a minimal reproduction of the bug\n\nhttps://stackblitz.com/edit/stackblitz-starters-jwxjng?file=src%2Fmain.ts\n\n### Please provide the exception or error you saw\n\n```true\nTypeError: Cannot assign to read only property 'dumbValue' of object '[object Object]'\n```\n\n\n### Please provide the environment you discovered this bug in (run `ng version`)\n\n```true\nAngular CLI: 17.0.7\r\nNode: 21.4.0 (Unsupported)\r\nPackage Manager: npm 10.2.5\r\nOS: win32 x64\r\n\r\nAngular: 17.0.7\r\n... animations, cli, common, compiler, compiler-cli, core, forms\r\n... platform-browser, platform-browser-dynamic, router\n```\n\n\n### Anything else?\n\n_No response_","author":{"url":"https://github.com/leonSouffes","@type":"Person","name":"leonSouffes"},"datePublished":"2023-12-19T13:12:00Z","url":"https://github.com/angular/angular/issues/53632"}
| 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:9f5d8907-f13b-5d45-ab34-213fffd03a40 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D29C:24ACB9:13381E3:1951829:6B01177B |
| html-safe-nonce | 2d736258334fb09baff0369719ac65ee8b0ff2619883bc3e733fbe5534b7b1f0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMjlDOjI0QUNCOToxMzM4MUUzOjE5NTE4Mjk6NkIwMTE3N0IiLCJ2aXNpdG9yX2lkIjoiODUyMDE3MDM1MzM3OTU3OTc3MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | b40274b68e3329173cc55cb016252f971d93fa676d8b7ffd064ad67d4cdcaff0 |
| hovercard-subject-tag | issue:2048633490 |
| 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/53632/issue_layout |
| twitter:image | https://opengraph.githubassets.com/06813f22327eba1ff73a8cefdba921a772909caaedfa3f0a9abb7bb59b926838/angular/angular/issues/53632 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/06813f22327eba1ff73a8cefdba921a772909caaedfa3f0a9abb7bb59b926838/angular/angular/issues/53632 |
| og:image:alt | Which @angular/* package(s) are the source of the bug? router Is this a regression? No Description I have a use case where I pass an environment const as a data for a specific route. And I just rem... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | leonSouffes |
| 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