form field validation (much better error messages)

This commit is contained in:
jonaswinkler
2021-01-03 13:09:16 +01:00
parent d7065bfde0
commit 677974924a
16 changed files with 102 additions and 30 deletions

View File

@@ -1,5 +1,8 @@
<div class="form-group">
<label [for]="inputId">{{title}}</label>
<input type="text" class="form-control" [id]="inputId" [(ngModel)]="value" (change)="onChange(value)">
<input type="text" class="form-control" [class.is-invalid]="error" [id]="inputId" [(ngModel)]="value" (change)="onChange(value)">
<small *ngIf="hint" class="form-text text-muted">{{hint}}</small>
<div class="invalid-feedback">
{{error}}
</div>
</div>