答案 0 :(得分:0)
您可以检查元素。获取 id / class ,然后执行此操作:
<div class="field"style="padding:1%">
<label>Pacs name</label>
<input placeholder="Pacs Name" type="text" [(ngModel)]="pacs.name" formControlName="pacName" required>
<label *ngIf="pacName.errors.required && addressForm.submitted" >This filed is required!!</label>
</div>
</form>