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