2.2.0 • Published 1 year ago

@stumpam/ngx-cz-in v2.2.0

Weekly downloads
1
License
MIT
Repository
github
Last release
1 year ago

NgxCzIn

Angular input for czech identification number (IČO) with validation.

From version 3 library uses Angular's standalone directives (Angular v15), so for backwards compatibility use version 2.

Quick Start

  1. Import NgxCzInDirective to your project (module) or component.
import { NgxCzInDirective } from '@stumpam/ngx-cz-in';

@Component({
  selector: 'ngx-cz-in-root',
  standalone: true,
  templateUrl: './app.component.html',
  changeDetection: ChangeDetectionStrategy.OnPush,
  imports: [NgxCzInDirective]
})
export class AppComponent
  1. Use in HTML template
  • add attributes min or max to validate even age of person with current id
<input ngxCzIn [formControl]="ctrl" [options]="options">
  1. Optional options to emit only valid cz id value
options: {
  emitInvalid?: boolean;
  // emits all typed characters not just valid / invalid complete id
  emitAll?: boolean;
  // it automatically add leading zeros for ins with them
  addLeadingZero: boolean;
  // If input is not empty, but value is not correct, on blur event it will fire validation
  nonEmptyError?: boolean;
}

Automatically emits invalidCzIn when length of string is valid but number is not valid identification number.

Works with formly

and use it in the template

<input ngxCzIn [formControl]="formControl" [options]="to.czInOptions>
2.2.0

1 year ago

2.1.0

2 years ago

2.0.2

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.3.0

2 years ago

1.2.0

2 years ago

1.1.2

3 years ago

1.1.1

3 years ago