Angular Library · v1.0.0

smart-form-error-mapper

Centralized validator → message config. One attribute on any input. Full i18n support. Zero repeated error boilerplate.

⚙ Global Error Message Config

Registered once in app.config.ts via provideFormErrors() — applies everywhere automatically.

// Runtime Options

[errorOnDirty] — show errors while typing
[showAll] — show all failing validators at once
Language / locale
Form completion
0%

Directive: appError

One attribute — error auto-injected on blur.

Component: <form-error>

Explicit placement + custom validator key.

Instant feedback: [errorOnDirty]="true"

Toggle [errorOnDirty] above to see errors appear as you type rather than after blur.

// app.component.ts — import once import { AppErrorDirective, FormErrorComponent } from 'smart-form-error-mapper'; // template — one attribute replaces all ngIf error boilerplate <input formControlName="email" appError /> // show errors while typing (not just on blur) <input formControlName="bio" appError [errorOnDirty]="true" /> // explicit placement with <form-error> component <input formControlName="password" /> <form-error [control]="form.get('password')" [showAll]="true" />