close
<form #form1="ngForm" (ngSubmit)="submit(form1)">
<div>
<label for="employeeName">employee name</label>
<input id="employeeName" type="text" name="employeeName" ngModel #employeeName="ngModel" required/>
<span *ngIf="employeeName.errors?.required && form1.submitted">employee name is required</span>
</div>
<div>
<label for="companyAddress">company address</label>
<input id="companyAddress" type="text" name="companyAddress" ngModel #companyAddress="ngModel" required/>
<span *ngIf="companyAddress.errors?.required && form1.submitted">company address is required</span>
</div>
<div>
<input type="submit" value="submit" [disabled]="form1.invalid" />
</div>
</form>
全站熱搜
留言列表