# ngx-error-message

> A package to display error messages in angular forms

Latest version **4.1.1** (published 2026-10-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install ngx-error-message
pnpm add ngx-error-message
yarn add ngx-error-message
bun add ngx-error-message
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 4.1.1 |
| Published | 2026-10-27 |
| First published | 2020-05-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Dependencies | 1 |
| Unpacked size | 59 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 1 |
| Author | Dario E Gonzalez B |
| Maintainers | darioegb |
| Keywords | ngx-error-message, ng-error, error message, angular handler error, angular, form validation, error handling, angular forms, validation messages, angular error messages |

## Links

- npm: https://www.npmjs.com/package/ngx-error-message
- Repository: https://github.com/darioegb/ngx-error-message
- Homepage: https://darioegb.github.io/ngx-error-message/
- Issues: https://github.com/darioegb/ngx-error-message/issues
- npm.io page: https://npm.io/package/ngx-error-message

## Dependencies (1)

- [tslib](https://npm.io/package/tslib.md) ^2.1.0

## Alternatives

- [@sentry/react-native](https://npm.io/package/@sentry/react-native.md) — 2.6M weekly downloads
- [@ardatan/aggregate-error](https://npm.io/package/@ardatan/aggregate-error.md) — 708.1K weekly downloads
- [custom-error-generator](https://npm.io/package/custom-error-generator.md) — 2.0K weekly downloads
- [@technik-sde/prosemirror-recreate-transform](https://npm.io/package/@technik-sde/prosemirror-recreate-transform.md) — 1.5K weekly downloads
- [@suchipi/error-utils](https://npm.io/package/@suchipi/error-utils.md) — 78 weekly downloads

## Recent versions

- 4.1.1 (latest) — 2026-10-27
- 4.0.0-next.4 (next) — 2026-09-10
- 4.1.0 — 2026-09-21
- 4.0.0 — 2026-09-11
- 4.0.0-next.3 — 2026-09-09
- 4.0.0-next.2 — 2026-09-08
- 4.0.0-next.1 — 2026-09-08
- 3.1.1 — 2026-09-08
- 3.1.0 — 2025-05-16
- 3.0.1 — 2024-11-08
- 3.0.0 — 2024-10-10
- 2.2.1 — 2022-08-16
- 2.2.0 — 2022-05-30
- 2.1.2 — 2022-05-26
- 2.1.1 — 2022-05-26
- … 9 more at https://npm.io/package/ngx-error-message/versions

## README

# 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

- [Live Example on StackBlitz](https://stackblitz.com/edit/ngx-error-message-example)

### Installation

```bash
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:

```html
<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](https://github.com/darioegb/ngx-error-message) for advanced examples, detailed setup, and customization.

---

> Github [@darioegb](https://github.com/darioegb)

---
_Source: https://npm.io/package/ngx-error-message · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
