0
我想在提交时也显示消息,所以请纠正我如何验证提交。 这里我的HTML表单组验证
<input type="text" class="form-control" formControlName="code" required>
<label [hidden]="ascForm.controls.code.valid || (ascForm.controls.code.pristine && ascForm.submitted)" class="errorMsg">Cannot save. You must specify a code.</label>
此验证条件是工作的罚款,如果我使用模板驱动的方法, 但现在我使用的模型驱动的,所以请大家指正提交条件。
感谢您的建议,它是这种情况的良好替代品。 – coder