An open API service indexing awesome lists of open source software.

https://github.com/stumpam/ngx-cz-tel

Angular library for czech telephone format input
https://github.com/stumpam/ngx-cz-tel

angular czech input phone slovak

Last synced: 3 months ago
JSON representation

Angular library for czech telephone format input

Awesome Lists containing this project

README

          

# NgxCzTel

Angular masked input for czech/slovak phone numbers.

Automatically adds +42(0|1) as prefix.

Emits on validity change only null or full phone number.

## Quick Start

1. Import NgxCzTel to your project

```typescript
import { NgxCzTelModule } from '@stumpam/ngx-cz-tel';

@NgModule({
declarations: [AppComponent],
imports: [BrowserModule, NgxCzTelModule, ReactiveFormsModule],
providers: [],
bootstrap: [AppComponent],
})
export class AppModule {}
```

2. Use in HTML template

```HTML

```

### Works with [formly](https://formly.dev)

If you want to add attributes directly to input element make custom Formly field and initialize it on `ngOnInit`

```typescript
ngOnInit() {
this.attributes = {
id: this.id,
...this.to.attributes,
};
}
```

and use it in the template

```HTML

```

> ⚠ Caution
>
> Attributes are bound just once on ngOnIput hook. Changes are matter of future improvements.