error TS2339: Property ‘value‘ does not exist on type ‘EventTarget‘. 7 <input type=“text“ [value]=

tags: typescript  angular

Error: src/app/app.component.html:7:78 - error TS2339: Property ‘value’ does not exist on type ‘EventTarget’.

7 <input type=“text” [value]=“inputValue” (input)=“inputValue = $event.target.value” >
~~~~~

src/app/app.component.ts:5:16
5 templateUrl: ‘./app.component.html’,
~~~~~~~~~~~~~~~~~~~~~~
Error occurs in the template of component AppComponent.

Do you have a small partner who learns Angular or TS encountered this problem? ? ? This is what I read video. I didn't have such a problem, I cried. . . . . .

But I still try to solve it, Baidu coming, it is basically a htmlelement, which is a htmlelement, which is the parent element of all HTML elements, but does not guarantee the attribute value. TypeScript detects this situation and raises an error. Mang Event.Target is converted to an appropriate HTML element to ensure that it is HTMLInputElement with value properties.

(<HTMLInputElement> Event.target) .value said that this is just like this, but I have tried it. So I will take a different path, using this method link:link.

I hope that my god can answer my doubts, rush.

Intelligent Recommendation

TS2339: property ‘of‘ does not exist on type ‘typeof Observable‘ - [email protected]

Two methods problem method method 1 Method 2 problem TS2339: property ‘of’ does not exist on type ‘typeof Observable’ - [email protected] method method 1 Find Tsconfig.json "Stri...

[VUE] TypeScript error "Property Does Not Exist on Value of Type"

The simplest solution is: plus as any eg:y.xIf an error is reported, then it is changed.(y as any).x Exposure global variable New file under SRCshime-vue.d.ts declare module 'nprogress';...

When js click event gets the parent element, an error is reported (Property ‘parentElement’ does not exist on type ‘EventTarget’)

Error: But I can get this value directly from the debugger, but it will report an error if I use it in this way. Later, under the other answers, the answer explained that this is only used for debuggi...

Angular Property ‘refreshAll‘ does not exist on type ‘{ value: any; }‘.

  Let DrawerContent: Any = {} // First Statement Type drawerContent = drawerRef.getContentComponent();...

React Transfer Eprecision Does Not Exist On Type 'Location <UNKNOWN>'. TS2339 and 'Propswithchildren <props>'. TS2339

Jump page 1、Property 'param1' does not exist on type 'Location'. TS2339 Solution 2、Property 'location' does not exist on type 'PropsWithChildren'. TS2339 Solution 1、Property ‘param1’ does ...

More Recommendation

Error on Property 'topicKey' does not exist on type '{}'

During the development process: used: Will report an error Can give msgDetail=null;...

TypeScript error property does not exist on type Object

TypeScript error property does not exist on type Object If the TypeScript by JS way to get the object properties, sometimes prompted shaped like a mistake Property 'value' does not exist on type 'Obje...

property xxx does not exist on type Object error

In TypeScript, if you use JS to obtain object properties, you will sometimes get an error like Property ‘xxx’ does not exist on type'Object’. Replace the ‘xxx’ in the cod...

error: Property ‘setState‘ does not exist on type ‘Home‘

Problem description: When I use typescript in react, I define a Home component and then use it in the componentsetStateThere will be an error: (as shown in the picture) Property 'setState' does not ex...

Jquery assigns a value to the input type=radio property

This is done, I have written this way without problems. Now there is such a situation: There is no problem with the first assignment, the second time is wrong, and the assignment is always selected by...

Copyright  DMCA © 2018-2026 - All Rights Reserved - www.programmersought.com  User Notice

Top