Skip to content

Event binding (#7) > The $event object compilation errorΒ #258

@JamesSkemp

Description

@JamesSkemp

https://ng-girls.gitbook.io/todo-list-tutorial/workshop-todo-list/event-binding#the-usdevent-object uses the following code:

<input [value]="title"
       (keyup)="changeTitle($event.target.value)">

However, as of now this results in a compilation error of Property 'value' does not exist on type 'EventTarget' in the separate HTML component.

Changing it to the following resolves the issue, but is less than ideal.

<input [value]="title"
       (keyup)="changeTitle($any($event.target).value)">

Since it's not ideal, not submitting a merge request as there may be a better way to handle this.

The following section, Pressing the Enter key, has a similar issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions