i have this html
<div class="horizontal">
<div>
<span> <input type="text" maxlength="100" placeholder="titulo" name="name"> </span>
<span> <input type="date" name="date"> </span>
</div>
<span> <input type="button" id="send" name="more" (click)="saveBooks(name.value, date.value)" value="Send"></span>
<!-- (click)="changeList(true) -->
</div>
and in the angular component I have
async saveBooks(name, date){
console.log('DATE ', name, date);
}
I get the following error:
ERROR TypeError: Cannot read property 'value' of undefined
at Object.eval [as handleEvent] (DatasComponent.html:22)
at handleEvent (core.js:23107)
It is not necessary to send data from parameter, you must use ng.model
I leave you an example
in the .html
in the .component
That way the variables
valueBook
andvalueDate
the view are bound to the component