npm.io
4.1.1 • Published 1 week ago

ngx-error-message

Licence
MIT
Version
4.1.1
Deps
1
Size
59 kB
Vulns
0
Weekly
0
Stars
1

NgxErrorMessage

Overview

NgxErrorMessage is an Angular library that displays dynamic error messages for reactive or template-driven forms, with optional internationalization support using @ngx-translate.

Live Example

Installation
npm install ngx-error-message --save
# Optional for translations:
npm install @ngx-translate/core @ngx-translate/http-loader --save
Quick Setup
  1. Import NgxErrorMessageModule in your main module and configure @ngx-translate if you want multilingual support.
  2. Add error messages to your translation files (assets/i18n/en.json).
  3. Use the directive in your form fields:
<input formControlName="password" ngxErrorMessage />
Customization
  • Customize error messages globally or per field.
  • Use the classNames attribute for custom styles.
  • Control when to show errors with the when attribute.
  • Easily add custom patterns and validations.
Documentation

See the official documentation for advanced examples, detailed setup, and customization.


Github @darioegb

Keywords