it seems to be an easy question, but nothing what i found worked for me. I have a standard input field in my component.html:
<div class="form-group">
<label>Serial</label>
<input type="text" name="serial" id="serial" [ngModel]="serial" [value]="serial" class="form-control">
</div>
So when the user now submitts the form, how do i get the value he typed into the field? If i do a simple console.log(this.serial)
in my onSubmit()
function, i get nothing. I declared serial: String;
in my component.ts