import { Component } from '@angular/core';
import { WrInput } from 'ngwr/input';
import { WrValidators } from 'ngwr/validators';
@Component({ imports: [WrInput] })
export class MyComponent {}iban
Check an IBAN's structure and mod-97 checksum.
Installation
Import the class, and @use the entry point in your global styles: without it the component renders unstyled.
Live demo
Try GB82 WEST 1234 5698 7654 32.
Usage
import { FormControl } from '@angular/forms';
import { WrValidators } from 'ngwr/validators';
const iban = new FormControl('', [WrValidators.iban]);
iban.setValue('GB82 WEST 1234 5698 7654 32'); // validAPI
| Name | Description | Type | Default |
|---|---|---|---|
signature | Add it to a validators array. | ValidatorFn | — |
checks | Structure and the ISO 13616 mod-97 checksum. The length per country is not checked. | — | — |
error key | On failure: { iban: true }. Empty value passes. | { iban: true } | — |