Title: `[class]` and `[style]` bindings are dropped when a directive has an output named `class` or `style` · Issue #71660 · angular/angular · GitHub
Open Graph Title: `[class]` and `[style]` bindings are dropped when a directive has an output named `class` or `style` · Issue #71660 · angular/angular
X Title: `[class]` and `[style]` bindings are dropped when a directive has an output named `class` or `style` · Issue #71660 · angular/angular
Description: Which @angular/* package(s) are the source of the bug? core Is this a regression? Yes. It works in 19.1.x and is broken from 19.2.0 onward. Description When a directive on an element declares an output whose public name is class, the tem...
Open Graph Description: Which @angular/* package(s) are the source of the bug? core Is this a regression? Yes. It works in 19.1.x and is broken from 19.2.0 onward. Description When a directive on an element declares an ou...
X Description: Which @angular/* package(s) are the source of the bug? core Is this a regression? Yes. It works in 19.1.x and is broken from 19.2.0 onward. Description When a directive on an element declares an ou...
Opengraph URL: https://github.com/angular/angular/issues/71660
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`[class]` and `[style]` bindings are dropped when a directive has an output named `class` or `style`","articleBody":"### Which @angular/* package(s) are the source of the bug?\n\ncore\n\n### Is this a regression?\n\nYes. It works in 19.1.x and is broken from 19.2.0 onward.\n\n### Description\n\nWhen a directive on an element declares an output whose public name is `class`, the template's `[class]` binding on that element never reaches the DOM. Static classes and `[class.foo]` bindings still work. The same happens with an output named `style` and `[style]`. Nothing is reported at compile time or at runtime.\n\n```ts\n@Directive({selector: '[dir]'})\nexport class Dir {\n @Output('class') out = new EventEmitter\u003cstring>();\n}\n\n@Component({\n selector: 'app-root',\n imports: [Dir],\n template: `\u003cdiv dir class=\"s\" [class]=\"cls()\" [class.p]=\"true\">\u003c/div>`,\n})\nexport class App {\n cls = signal('b');\n}\n```\n\nExpected classes on the `div`: `b p s`, which is what you get without `dir`.\nActual classes: `p s`. After `cls.set('b2')`, they are still `p s`.\n\nThese forms are affected too:\n\n- `[style]` with an output named `style`.\n- Interpolated `class=\"s {{x}}\"` and `style=\"width: {{w}}px\"`.\n- Signal outputs, such as `output({alias: 'class'})`.\n- Host directives that expose an output as `class`, such as `outputs: ['out: class']`.\n\n`[className]`, `[class.foo]`, host bindings and `(class)` listeners still work.\n\nCause: `setShadowStylingInputFlags` in `packages/core/src/render3/view/directives.ts` sets `TNodeFlags.hasClassInput`/`hasStyleInput` for outputs as well as inputs. The `[class]` value is then routed to directive inputs named `class`. None exist, so the value is dropped. This started with #60036, a refactor that moved the flag into helpers shared by inputs and outputs.\n\n### Please provide a link to a minimal reproduction of the bug\n\nNo hosted reproduction. The snippet in the description is self-contained: paste it into any Angular 19.2+ app. The linked PR adds regression tests.\n\n### Please provide the exception or error you saw\n\n```true\nNone. The binding is dropped silently.\n```\n\n### Please provide the environment you discovered this bug in (run `ng version`)\n\n```true\nAngular: 19.2.0 and later, including angular/angular main at 8260542ce0.\nReproduced with acceptance tests in packages/core/test/acceptance (AOT and JIT).\n```\n\n### Anything else?\n\nA PR with a fix and regression tests follows: the flag is set only while collecting inputs.\n","author":{"url":"https://github.com/Flarette","@type":"Person","name":"Flarette"},"datePublished":"2026-10-27T14:19:04Z","url":"https://github.com/angular/angular/issues/71660"}
| 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:5eda7cdd-0191-8abe-b051-3b2805451b37 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B144:4279A:11C5B68:17EA21C:6B012768 |
| html-safe-nonce | d99d914329edfaa7611178c44d401a0b190cd163b6c4b114f0026ff47162c5f7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMTQ0OjQyNzlBOjExQzVCNjg6MTdFQTIxQzo2QjAxMjc2OCIsInZpc2l0b3JfaWQiOiIxNzk1MjM0NjA4NTQ4MjI2OTIwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | d8312d0c26de5b8bf39b037f99d17267c9acf6dece9233311f623ae5bdd7a607 |
| hovercard-subject-tag | issue:6061023333 |
| 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/71660/issue_layout |
| twitter:image | https://opengraph.githubassets.com/53bd47b50cea70a2a7a1d8866a84b6009262858fa61f47d93785f2921d668657/angular/angular/issues/71660 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/53bd47b50cea70a2a7a1d8866a84b6009262858fa61f47d93785f2921d668657/angular/angular/issues/71660 |
| og:image:alt | Which @angular/* package(s) are the source of the bug? core Is this a regression? Yes. It works in 19.1.x and is broken from 19.2.0 onward. Description When a directive on an element declares an ou... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Flarette |
| 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