src/app/core/common-components/error-hint/error-hint.component.ts
selector | app-error-hint |
imports |
KeyValuePipe
|
styleUrls | ./error-hint.component.scss |
templateUrl | ./error-hint.component.html |
Inputs |
form | |
Type : UntypedFormControl
|
|
import { Component, Input } from "@angular/core";
import { UntypedFormControl } from "@angular/forms";
import { KeyValuePipe } from "@angular/common";
@Component({
selector: "app-error-hint",
templateUrl: "./error-hint.component.html",
styleUrls: ["./error-hint.component.scss"],
imports: [KeyValuePipe],
})
export class ErrorHintComponent {
@Input() form: UntypedFormControl;
}
@for (err of form?.errors | keyvalue; track err) {
<div>
{{ err.value["errorMessage"] }}
<ng-content></ng-content>
</div>
}
./error-hint.component.scss
:host {
position: absolute;
}