You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[class] and [style] bindings are dropped when a directive has an output named class or style #71660
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 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.
Expected classes on the div: b p s, which is what you get without dir.
Actual classes: p s. After cls.set('b2'), they are still p s.
These forms are affected too:
[style] with an output named style.
Interpolated class="s {{x}}" and style="width: {{w}}px".
Signal outputs, such as output({alias: 'class'}).
Host directives that expose an output as class, such as outputs: ['out: class'].
[className], [class.foo], host bindings and (class) listeners still work.
Cause: 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.
Please provide a link to a minimal reproduction of the bug
No hosted reproduction. The snippet in the description is self-contained: paste it into any Angular 19.2+ app. The linked PR adds regression tests.
Please provide the exception or error you saw
None. The binding is dropped silently.
Please provide the environment you discovered this bug in (run ng version)
Angular: 19.2.0 and later, including angular/angular main at 8260542ce0.
Reproduced with acceptance tests in packages/core/test/acceptance (AOT and JIT).
Anything else?
A PR with a fix and regression tests follows: the flag is set only while collecting inputs.
5. A maintainer would know better but I think you don't have to open an issue every time you send a PR
Idk, haven't found an explicit rule for that. I think it has it's value to increase visibility for agents scanning the repo and keep things consistent.
Activity
erkamyaman commentedon Oct 27, 2026
A maintainer would know better but I think you don't have to open an issue every time you send a PR
Flarette commentedon Oct 27, 2026
Idk, haven't found an explicit rule for that. I think it has it's value to increase visibility for agents scanning the repo and keep things consistent.
erkamyaman commentedon Oct 27, 2026
That's for an Angular team member to decide. Whether they see value in these or not.