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
- Host: GitHub
- URL: https://github.com/stumpam/ngx-cz-tel
- Owner: stumpam
- License: mit
- Created: 2020-02-26T18:19:40.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-06-04T09:19:09.000Z (about 5 years ago)
- Last Synced: 2025-08-16T01:29:05.999Z (11 months ago)
- Topics: angular, czech, input, phone, slovak
- Language: TypeScript
- Size: 1.65 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
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.