我正在使用 Angular 反应式表单构建一个通用表单。我有以下用于输入元素的通用 Html
<div class="form-input form-group" [formGroup]="group">
<div class="row">
<div class="col-2 font-label">
<label>{{ config.label }}</label>
</div>
<div class="col-10">
<input type="text" [attr.placeholder]="config.placeholder" disabled="disabled" class="form-control"
[formControlName]="config.name">
<div [hidden]="!(group.controls[config.name].invalid && group.controls[config.name].touched)">
<small class="form-text text-danger" [hidden]="!group.controls[config.name]?.errors?.required"></small>
<small class="form-text text-danger" [hidden]="!group.controls[config.name]?.errors?.minlength"></small>
<small class="form-text text-danger" [hidden]="!group.controls[config.name]?.errors?.maxlength"></small>
</div>
</div>
</div>
</div>
但对于以下!group.controls[config.name]?.errors?.required
它告诉我Identifier 'required' is not defined
。minlength
和相同maxlength
。从哪里我可以得到minlength
和maxlength
required errors?