Skip to content

fix(host): compile every stacked @HostListener and @HostBinding of a member - #601

Open
Rush wants to merge 1 commit into
voidzero-dev:mainfrom
encharm:fix/stacked-host-decorators
Open

Rush wants to merge 1 commit into
voidzero-dev:mainfrom
encharm:fix/stacked-host-decorators

Conversation

@Rush

@Rush Rush commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Only the first @HostListener or @HostBinding of a member was compiled:

@HostListener('click') @HostListener('keydown.enter') activate() {}
@HostBinding('class.on') @HostBinding('attr.aria-pressed') on = true;

listened to clicks only and bound only one of the two. Like ngtsc, each decorator is now its own host listener or binding.

tests/stacked_host_decorators_test.rs compares the hostBindings function with @angular/compiler-cli 21.0.1's for the same class: all four listeners (two passing $event), both bindings and hostVars: 3. It fails without the change.

…member

Only the first `@HostListener` or `@HostBinding` of a member was compiled:
`@HostListener('click') @HostListener('keydown.enter') activate() {}` listened
to clicks only. Like ngtsc, each decorator is now its own host listener or
binding.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant