Browser shows failed to compile. Please help
Error : Property 'value' does not exist on type 'EventTarget'
HTML code :
<div>
<label>Enter Length</label>
<input (input)="onChangeLength($event.target.value)" />
</div>
Typescript code
onChangeLength(value: string){
const parsedValue = parseInt(value);
if(!isNaN(parsedValue)){
this.lenght = parsedValue;
}
}
CodePudding user response:
event.target
is of type EventTarget
which does not have the property value
: