I have a straightforward form to transmit data to my component without refreshing the page.
I've tried to override the submit function by using "return false," but it doesn't work as expected, and the page still refreshes.
Here is the HTML:
<form id="ngForm" [formGroup]="nameForm" (submit)="onSumbit()">
<div style="padding-bottom:10px;padding-top:10px;">
<label>Name</label>
</div>
<input required formControlName="name"></input>
<div style="float:right; padding-top:2cm">
<button form="ngForm">Search</button>
</div>
</form>
And here is the TypeScript:
onSubmit() {
let user: UserInfo;
user.name = 'test';
}