-
Notifications
You must be signed in to change notification settings - Fork 26.6k
Closed
Labels
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentAn issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: coreIssues related to the framework runtimeIssues related to the framework runtimecross-cutting: types
Milestone
Description
🚀 feature request
Relevant Package
This feature request is for @angular/core.
Description
With the strictTemplates: true
Angular compiler setting, it can be tough to deal with native $event
in event bindings.
Describe the solution you'd like
I would like to be able to do
<input (input)="onInput($event.target.value)">
where$event
isInputEvent
or$event.target
/$event.currentTarget
isHTMLInputElement
<button (click)="onClick($event.target.textContent)>Hello <span>World</span></button>
where$event
isMouseEvent
and$event.target
/$event.currentTarget
isHTMLButtonElement
Describe alternatives you've considered
We can use $any()
casting, but that is counterintuitive when having strictTemplates
compilation enabled.
Maybe $event.currentTarget
is easier to work with than $event.target
for this feature.
Samuel-Therrien-Beslogic, theo-auffeuvre, maximeBAY, felix029, Teamop and 1 more
Metadata
Metadata
Assignees
Labels
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentAn issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: coreIssues related to the framework runtimeIssues related to the framework runtimecross-cutting: types