Skip to content

Commit

Permalink
docs(lib): update docs in the library
Browse files Browse the repository at this point in the history
  • Loading branch information
stumpam committed Mar 2, 2020
1 parent c1c5646 commit eb8f459
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
23 changes: 22 additions & 1 deletion libs/ngx-cz-tel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,25 @@ export class AppModule {}
<ngx-cz-tel [formControl]="ctrl"></ngx-cz-tel>
```

Works with [formly](https://formly.dev)
### 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
<ngx-cz-tel [formControl]="formControl" [attributes]="attributes"></ngx-cz-tel>
```

> ⚠ Caution
>
> Attributes are bound just once on ngOnIput hook. Changes are matter of future improvements.
2 changes: 1 addition & 1 deletion libs/ngx-cz-tel/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@stumpam/ngx-cz-tel",
"version": "1.0.0",
"version": "1.1.0",
"description": "Angular masked input for czech/slovak phone numbers.",
"homepage": "https://github.com/stumpam/ngx-cz-tel",
"author": "Martin Štumpa (https://github.com/stumpam)",
Expand Down

0 comments on commit eb8f459

Please sign in to comment.