Conversation
Moves the logic for parsing event names out into methods on the `BindingParser` so we don't have to duplicate it. Also updates the types to more accurately represent the runtime value.
Currently the TCB generation code doesn't handle targeted events (e.g. `(document:click)`) which ends up binding to the current element and can have type inference implications. These changes take the event's `target` into account.
Fixes that we weren't accounting for targeted events when creating the AST for `@HostListener`-decorated members.
devversion
approved these changes
Mar 26, 2025
| constructor( | ||
| name: string, | ||
| targetOrPhase: string, | ||
| targetOrPhase: string | null, |
Member
There was a problem hiding this comment.
OOC: was the value before just empty if there isn't a target or phase?
Member
Author
There was a problem hiding this comment.
It was a null that was non-null-asserted to any.
Member
|
This PR was merged into the repository by commit 1e6faad. The changes were merged into the following branches: main |
alxhub
pushed a commit
that referenced
this pull request
Mar 27, 2025
Currently the TCB generation code doesn't handle targeted events (e.g. `(document:click)`) which ends up binding to the current element and can have type inference implications. These changes take the event's `target` into account. PR Close #60561
alxhub
pushed a commit
that referenced
this pull request
Mar 27, 2025
Fixes that we weren't accounting for targeted events when creating the AST for `@HostListener`-decorated members. PR Close #60561
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the following issues with how we type check event listeners:
refactor(compiler): allow name parsing logic to be reused
Moves the logic for parsing event names out into methods on the
BindingParserso we don't have to duplicate it. Also updates the types to more accurately represent the runtime value.fix(compiler-cli): set correct target when type checking events
Currently the TCB generation code doesn't handle targeted events (e.g.
(document:click)) which ends up binding to the current element and can have type inference implications. These changes take the event'stargetinto account.fix(compiler-cli): correctly parse event name in HostListener
Fixes that we weren't accounting for targeted events when creating the AST for
@HostListener-decorated members.