curso-angular icon indicating copy to clipboard operation
curso-angular copied to clipboard

Problemas com Property/Event Binding

Open Renato-Afonso opened this issue 5 years ago • 4 comments

Eu tentei aplicar o código "<input type="text" [value] = "title" (keyup.enter) = "title =$event.target.value"/>", mas um erro SEMPRE ocorre...meu prompt de comando fica dizendo:

Object is possibly 'null'.

(keyup.enter) = "title =$event.target.value"/>

E também

Property 'value' does not exist on type 'EventTarget'.

(keyup.enter) = "title =$event.target.value"/>;

Eu segui as orientações da aula à risca, o que estou fazendo de errado? Por acaso preciso adicionar outras linhas de código ou tem outro addon que eu precise fazer o download?

Renato-Afonso avatar Nov 29 '20 19:11 Renato-Afonso

@Renato-Afonso o angular agora é mais restrito em relação a isso. Tente o seguinte, isso vai checar por null: "title =$event?.target?.value"

loiane avatar Dec 07 '20 22:12 loiane

Opa muito obrigado, vou tentar sim 😀👍

Em seg, 7 de dez de 2020 19:07, Loiane Groner [email protected] escreveu:

@Renato-Afonso https://github.com/Renato-Afonso o angular agora é mais restrito em relação a isso. Tente o seguinte, isso vai checar por null: "title =$event?.target?.value"

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/loiane/curso-angular/issues/94#issuecomment-740209316, or unsubscribe https://github.com/notifications/unsubscribe-auth/AR54VCLAZ3SN74X4W4U3GULSTVG3HANCNFSM4UGXBKBQ .

Renato-Afonso avatar Dec 07 '20 22:12 Renato-Afonso

Na versão 12 isso não resolve. Tente o seguinte: $any($event.target).value

tonhozi avatar Jun 10 '21 04:06 tonhozi

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Feb 28 '24 02:02 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Mar 07 '24 02:03 github-actions[bot]