# @kovalenko/validators

> match

Latest version **1.0.0** (published 2023-03-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install @kovalenko/validators
pnpm add @kovalenko/validators
yarn add @kovalenko/validators
bun add @kovalenko/validators
```

## Health

**Score 35/100 (D)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2023-03-02 |
| First published | 2021-04-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 22.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Kovalenko |
| Maintainers | kovalenko |
| Keywords | angular, validator, match |

## Links

- npm: https://www.npmjs.com/package/@kovalenko/validators
- Repository: https://github.com/menelai/scroll-here
- Homepage: https://github.com/menelai/scroll-here#readme
- Issues: https://github.com/menelai/scroll-here/issues
- npm.io page: https://npm.io/package/@kovalenko/validators

## Dependencies (1)

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

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2023-03-02
- 0.1.1 — 2021-05-13
- 0.0.5 — 2021-04-30
- 0.0.4 — 2021-04-30
- 0.0.3 — 2021-04-29
- 0.0.2 — 2021-04-29

## README

# Validators

match

## Installation

```
npm install @kovalenko/validators
```

## Supported API

### Match

Validates whether input value matches specified value

Selector: `[ngcMatch]`

Name | Description
--- | ---
`@Input() ngcMatch: any` | Value to compare with


## Usage

First, import the ValidatorsModule to your module:

```typescript
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { ValidatorsModule } from '@kovalenko/validators';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppComponent } from './app';

@NgModule({
  imports: [BrowserModule, ValidatorsModule],
  declarations: [AppComponent],
  bootstrap: [AppComponent],
})
export class AppModule {}

platformBrowserDynamic().bootstrapModule(AppModule);
```

In this example, errors will be shown when pass1 and pass2 do not match

```typescript
import { Component } from '@angular/core';

@Component({
  selector: 'app',
  template: `
    <input type="password" name="pass1" [(ngModel)]="pass1">
    <input type="password" name="pass2" [(ngModel)]="pass2" [ngcMatch]="pass1" #pass2Model="ngModel">
    <div *ngIf="pass2Model.hasError('ngcMatch')">Passwords mismatch</div>
  `,
})
export class AppComponent {
  pass1: string;
  pass2: string;
}
```

## License

MIT

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