Repository navigation
Conversation
JoostK
force-pushed
the
ngtsc-ttc-outputs
branch
2 times, most recently
from
October 12, 2019 20:03
f1155b2 to
922deae
Compare
JoostK
force-pushed
the
ngtsc-ttc-outputs
branch
3 times, most recently
from
October 16, 2019 20:36
5edee97 to
aca3790
Compare
Until now, the template type checker has not checked any of the event bindings that could be present on an element, for example ``` <my-cmp (changed)="handleChange($event)" (click)="handleClick($event)"></my-cmp> ``` has two event bindings: the `change` event corresponding with an `@Output()` on the `my-cmp` component and the `click` DOM event. This commit adds functionality to the template type checker in order to type check both kind of event bindings. This means that the correctness of the bindings expressions, as well as the type of the `$event` variable will now be taken into account during template type checking. Resolves FW-1598
JoostK
force-pushed
the
ngtsc-ttc-outputs
branch
from
October 17, 2019 18:06
8bef5b4 to
3d3986c
Compare
JoostK
marked this pull request as ready for review
October 17, 2019 18:46
alxhub
approved these changes
Oct 18, 2019
| return false; | ||
| } else if (code === 2695 /* Left side of comma operator is unused and has no side effects. */) { | ||
| return false; | ||
| } else if (code === 7006 /* Parameter '$event' implicitly has an 'any' type. */) { |
Member
There was a problem hiding this comment.
Can we make it explicit instead?
($event: any) => ...?
Member
Author
There was a problem hiding this comment.
Nope, it would defeat type inference.
Member
|
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.
Until now, the template type checker has not checked any of the event
bindings that could be present on an element, for example
has two event bindings: the
changeevent corresponding with an@output()on themy-cmpcomponent and theclickDOM event.This commit adds functionality to the template type checker in order to
type check both kind of event bindings. This means that the correctness
of the bindings expressions, as well as the type of the
$eventvariable will now be taken into account during template type checking.
Resolves FW-1598