我有 2 个字段的反应形式:名称和地址
constructor(private fb: FormBuilder) {
this.empForm = this.fb.group({
name: ['', Validators.required],
address: ''
});
}
Htmp模板:
<form [formGroup]="empForm" novalidate>
<input class="form-control" formControlName="name" [ngbTooltip]="tipContent" #t="ngbTooltip" triggers="manual">
<input class="form-control" formControlName="address">
</form>
我想在输入无效时显示工具提示。我怎样才能做到这一点?