成功提交表单后,表单字段再次变为必填字段。请注意,页面不会在提交时刷新,但会重置表单。
<form #contactUsForm>
<mat-form-field>
<input type="text" matInput
(blur)="nameValidate()" [(ngModel)]="_userName" name="uName" required>
</mat-form-field>
<mat-form-field>
<input type="email" matInput [(ngModel)]="_userEmail" name="uEmail"
(blur)="emailValidate()" required>
</mat-form-field>
<div>
<button type="submit" (click)="onSubmit();contactUsForm.reset()"
mat-raised-button>Submit </button>
</div>
</form>
事件触发有什么问题吗?