Title: Dynamic component setInput does not respect internal input value changes (signal based inputs/model) · Issue #59376 · angular/angular · GitHub
Open Graph Title: Dynamic component setInput does not respect internal input value changes (signal based inputs/model) · Issue #59376 · angular/angular
X Title: Dynamic component setInput does not respect internal input value changes (signal based inputs/model) · Issue #59376 · angular/angular
Description: Which @angular/* package(s) are the source of the bug? core Is this a regression? Yes Description I am trying to switch to signal based inputs with dynamic components. I use model as input (because input is read only and can't be changed...
Open Graph Description: Which @angular/* package(s) are the source of the bug? core Is this a regression? Yes Description I am trying to switch to signal based inputs with dynamic components. I use model as input (because...
X Description: Which @angular/* package(s) are the source of the bug? core Is this a regression? Yes Description I am trying to switch to signal based inputs with dynamic components. I use model as input (because...
Opengraph URL: https://github.com/angular/angular/issues/59376
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Dynamic component setInput does not respect internal input value changes (signal based inputs/model)","articleBody":"### Which @angular/* package(s) are the source of the bug?\n\ncore\n\n### Is this a regression?\n\nYes\n\n### Description\n\nI am trying to switch to signal based inputs with dynamic components.\nI use model as input (because input is read only and can't be changed).\n` open = model\u003cboolean>();`\n\nA close() method (on dialog close click) calls:\n`this.open.set(false);`\n\nIt all works as intended.\nHowever, when i try to open the dialog again, using:\n`this.componentRef.setInput('open', state);`\nIt fails. Because it still sees it as true and does not update the signal value.\n\nIf i add \n```\nthis.componentRef.setInput('open', false);\nthis.componentRef.setInput('open', true);\n```\nIt works - because i explicitly set it to false first with setInput - but fails if signal model is updated internally.\n\nWhy does it not check against the signal real value, why does it still assume it is true? Is there some internal change detection layer that does not respect the signal changes inside the component?\n\n`...instance.open.set(state);` works - but direct instance manipulation is not recommended.\n\n\n### Please provide a link to a minimal reproduction of the bug\n\nhttps://stackblitz.com/edit/angular-awwtth?file=src%2Fapp%2Fapp.component.ts\n\n### Please provide the exception or error you saw\n\n```true\n\n```\n\n### Please provide the environment you discovered this bug in (run `ng version`)\n\n```true\nAngular CLI: 18.2.11\nNode: 20.15.1\nPackage Manager: npm 10.7.0\nOS: linux x64\n\nAngular: 18.2.10\n... animations, common, compiler, compiler-cli, core, forms\n... language-service, localize, platform-browser\n... platform-browser-dynamic, router\n\nPackage Version\n---------------------------------------------------------\n@angular-devkit/architect 0.1802.11\n@angular-devkit/build-angular 18.2.11\n@angular-devkit/core 18.2.11\n@angular-devkit/schematics 18.2.11\n@angular/cdk 18.2.11\n@angular/cli 18.2.11\n@schematics/angular 18.2.11\nng-packagr 18.2.1\nrxjs 7.8.1\ntypescript 5.5.4\nzone.js 0.14.10\n```\n\n### Anything else?\n\n_No response_","author":{"url":"https://github.com/maurotamm","@type":"Person","name":"maurotamm"},"datePublished":"2025-01-06T12:43:23Z","url":"https://github.com/angular/angular/issues/59376"}
| 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:31c03def-ec49-eb63-d4e2-159a70e417ff |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EC6E:36A3E:2FD8F32:3FD355E:6B01E89C |
| html-safe-nonce | a614222527a023ea40bd1eb3d08a5a3e814cc408dffa3298ad979017255169e3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQzZFOjM2QTNFOjJGRDhGMzI6M0ZEMzU1RTo2QjAxRTg5QyIsInZpc2l0b3JfaWQiOiIyODEzNDE5NDQxNDM2NjE2ODYxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 9c13d55c48021cb826491aac626a2e39b5e6a7dbec2443a4f0dbb23d53b69fa2 |
| hovercard-subject-tag | issue:2770582761 |
| 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/59376/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f9d4e3729b38926bb6d14a7edb6d5cf515fa96a7b1c4f70e650ac5b9e5d95595/angular/angular/issues/59376 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f9d4e3729b38926bb6d14a7edb6d5cf515fa96a7b1c4f70e650ac5b9e5d95595/angular/angular/issues/59376 |
| og:image:alt | Which @angular/* package(s) are the source of the bug? core Is this a regression? Yes Description I am trying to switch to signal based inputs with dynamic components. I use model as input (because... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | maurotamm |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| 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 | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width