大家好?如果有值,我如何验证#permissionInput,顺便说一句,这是有角度的。
<input
#permissionInput
type="text"
class="col dropdown"
placeholder="Select permission group ..."
(focus)="onFocus(dropdownContent)"
(blur)="onBlur()"
(input)="onInput(permissionInput.value)"
[ngClass]="{ 'is-invalid': pGroup.invalid && (pGroup.dirty || pGroup.touched) }"
/>
<small
*ngIf="permissionInput.value.invalid && (permissionInput.value.dirty || permissionInput.value.touched)"
class="form-text text-muted danger invalid-feedback1 ml-1"
>
<div *ngIf="permissionInput.value.errors.required">
Name is required.
</div>
</small>
``