Skip to content

fix(compiler-cli): correctly type check host listeners to own outputs#62965

Closed
crisbeto wants to merge 2 commits intoangular:mainfrom
crisbeto:62783/host-events-type
Closed

fix(compiler-cli): correctly type check host listeners to own outputs#62965
crisbeto wants to merge 2 commits intoangular:mainfrom
crisbeto:62783/host-events-type

Conversation

@crisbeto
Copy link
Copy Markdown
Member

@crisbeto crisbeto commented Aug 2, 2025

Currently the code that type checks host bindings assumes that all listeners are bound to the DOM, however that's not the case since host bindings can also bind to own outputs.

These changes update the TCB to generate the proper code for type checking such outputs.

Fixes #62783.

Allows the target binder to resolve directives set on the host element.
@crisbeto crisbeto added the target: patch This PR is targeted for the next patch release label Aug 2, 2025
@angular-robot angular-robot bot added the area: compiler Issues related to `ngc`, Angular's template compiler label Aug 2, 2025
@ngbot ngbot bot added this to the Backlog milestone Aug 2, 2025
@crisbeto crisbeto force-pushed the 62783/host-events-type branch from eb76682 to 49fd593 Compare August 2, 2025 08:15
@crisbeto crisbeto requested a review from JoostK August 2, 2025 08:15
@crisbeto crisbeto added the action: review The PR is still awaiting reviews from at least one requested reviewer label Aug 2, 2025
@crisbeto crisbeto marked this pull request as ready for review August 2, 2025 08:15
@crisbeto crisbeto force-pushed the 62783/host-events-type branch from 49fd593 to dfcca8f Compare August 2, 2025 11:57
Currently the code that type checks host bindings assumes that all listeners are bound to the DOM, however that's not the case since host bindings can also bind to own outputs.

These changes update the TCB to generate the proper code for type checking such outputs.

Fixes angular#62783.
@crisbeto crisbeto force-pushed the 62783/host-events-type branch from dfcca8f to 35f1f18 Compare August 2, 2025 12:52
@crisbeto crisbeto added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Aug 5, 2025
@crisbeto
Copy link
Copy Markdown
Member Author

crisbeto commented Aug 5, 2025

This PR was merged into the repository by commit fb1fc82.

The changes were merged into the following branches: main, 20.1.x

@crisbeto crisbeto closed this in 0950524 Aug 5, 2025
crisbeto added a commit that referenced this pull request Aug 5, 2025
…#62965)

Currently the code that type checks host bindings assumes that all listeners are bound to the DOM, however that's not the case since host bindings can also bind to own outputs.

These changes update the TCB to generate the proper code for type checking such outputs.

Fixes #62783.

PR Close #62965
crisbeto added a commit that referenced this pull request Aug 5, 2025
…62965)

Allows the target binder to resolve directives set on the host element.

PR Close #62965
crisbeto added a commit that referenced this pull request Aug 5, 2025
…#62965)

Currently the code that type checks host bindings assumes that all listeners are bound to the DOM, however that's not the case since host bindings can also bind to own outputs.

These changes update the TCB to generate the proper code for type checking such outputs.

Fixes #62783.

PR Close #62965
@angular-automatic-lock-bot
Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 5, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: compiler Issues related to `ngc`, Angular's template compiler target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: typeCheckHostBindings: true not infering type correctly for host directive output

2 participants