{"id":13990818,"url":"https://github.com/dirkluijk/ngx-typesafe-forms","last_synced_at":"2025-03-25T22:32:29.010Z","repository":{"id":35194135,"uuid":"216841478","full_name":"dirkluijk/ngx-typesafe-forms","owner":"dirkluijk","description":"Because FormControl\u003cT\u003e is more awesome than FormControl!","archived":false,"fork":false,"pushed_at":"2024-01-05T15:05:59.000Z","size":1037,"stargazers_count":40,"open_issues_count":18,"forks_count":12,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-09-19T05:06:29.532Z","etag":null,"topics":["angular","forms","generics","reactive","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dirkluijk.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-10-22T15:00:52.000Z","updated_at":"2024-06-18T18:58:39.000Z","dependencies_parsed_at":"2024-01-05T16:25:36.154Z","dependency_job_id":"23a385a9-4827-4ab4-8d12-150b1fc4ded7","html_url":"https://github.com/dirkluijk/ngx-typesafe-forms","commit_stats":{"total_commits":76,"total_committers":7,"mean_commits":"10.857142857142858","dds":0.513157894736842,"last_synced_commit":"8af67121d0236f0a2e33a211f88ce3b75e37ff8b"},"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dirkluijk%2Fngx-typesafe-forms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dirkluijk%2Fngx-typesafe-forms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dirkluijk%2Fngx-typesafe-forms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dirkluijk%2Fngx-typesafe-forms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dirkluijk","download_url":"https://codeload.github.com/dirkluijk/ngx-typesafe-forms/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222099608,"owners_count":16931447,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["angular","forms","generics","reactive","typescript"],"created_at":"2024-08-09T13:03:18.388Z","updated_at":"2024-10-29T19:09:38.807Z","avatar_url":"https://github.com/dirkluijk.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# Type-safe Forms for Angular 📝\n\n\u003e Because `FormControl\u003cT\u003e` is more awesome than `FormControl`!\n\n[![NPM version](http://img.shields.io/npm/v/ngx-typesafe-forms.svg?style=flat-square)](https://www.npmjs.com/package/ngx-typesafe-forms)\n[![NPM downloads](http://img.shields.io/npm/dm/ngx-typesafe-forms.svg?style=flat-square)](https://www.npmjs.com/package/ngx-typesafe-forms)\n![Build status](https://github.com/dirkluijk/ngx-typesafe-forms/actions/workflows/main.yml/badge.svg?branch=master)\n[![All Contributors](https://img.shields.io/badge/all_contributors-2-orange.svg?style=flat-square)](#contributors-)\n\n## Using Angular 14?\n\nIf you are using Angular 14 or higher, there is no need for using this library. \nInstead, we recommend you to use the [default Angular type-safe forms](https://angular.io/guide/typed-forms) in that case.\n\nIf you still want to use some of the additional features mentioned below, we recommend version `2.0` of this library, which is compatible with Angular 14.\n\n| Angular version     |                                                                Version |\n|---------------------|-----------------------------------------------------------------------:|\n| Angular 16          | [`2.2.x`](https://github.com/dirkluijk/ngx-typesafe-forms/tree/v2.2.0) |\n| Angular 15          | [`2.1.x`](https://github.com/dirkluijk/ngx-typesafe-forms/tree/v2.1.0) |\n| Angular 14          | [`2.x.x`](https://github.com/dirkluijk/ngx-typesafe-forms/tree/v2.0.0) |\n| Angular 13          | [`1.6.x`](https://github.com/dirkluijk/ngx-typesafe-forms/tree/v1.6.1) |\n| Angular 12          | [`1.5.x`](https://github.com/dirkluijk/ngx-typesafe-forms/tree/v1.5.2) |\n| Angular 11          | [`1.4.x`](https://github.com/dirkluijk/ngx-typesafe-forms/tree/v1.4.3) |\n| Angular 10 or lower | [`1.3.x`](https://github.com/dirkluijk/ngx-typesafe-forms/tree/v1.3.1) |\n\n## Overview\n\n### What? 🤔\n\nA small library to make Angular Forms more type-safe!\n\n* Type-safe versions of `FormControl`, `FormGroup`, `FormArray` and `ControlValueAccessor`\n* 100% compatible with `@angular/forms` and existing Angular libraries!\n* Easy to use!\n* Additional read-only properties `value$`, `valid$`, `pristine$`, `errors$`, `enabled$` and more.\n* A default implementation for `ControlValueAccessor`\n* Type-safe validators\n\n### Why? 🤷‍♂️\n\nAngular Forms are not very type-safe (at least, up until Angular 13). \nThis library makes your form code more type-safe. More type-safety means smaller risks for bugs!\n\n## Installation 🌩\n\n##### npm\n\n```\nnpm install ngx-typesafe-forms\n```\n\n##### yarn\n\n```\nyarn add ngx-typesafe-forms\n```\n\n## Usage 🕹\n\n### Basic example\n\nJust import your `FormControl`, `FormGroup`, `FormArray` and `ControlValueAccessor`\nfrom `ngx-typesafe-forms` instead of `@angular/forms` and you are done!\n\n### Additional reactive properties\n\nBesides the type-safety, we also provide additional reactive properties.\n\n```typescript\nconst myControl = new FormControl\u003cstring\u003e('bar');\n\n// subscribe to all values, including the existing value!\nmyControl.value$.subscribe((value) =\u003e {\n  /* ... */\n});\n\n// subscribe to validity changes, including the existing valid state!\nmyControl.valid$.subscribe((valid) =\u003e {\n  /* ... */\n});\n```\n\nThe recommended properties are:\n\n* `value$`\n* `errors$`\n* `enabled$`\n* `pristine$`\n* `valid$`\n* `status$`\n* `validValue$`\n* `rawValue$`\n\nAdditionally, we also provide some of their counterparts:\n\n* `disabled$`\n* `dirty$`\n* `invalid$`\n\nNOTE: all of these streams also include the current (initial) values.\n\n## Contributors ✨\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/dirkluijk\"\u003e\u003cimg src=\"https://avatars2.githubusercontent.com/u/2102973?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eDirk Luijk\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/dirkluijk/ngx-typesafe-forms/commits?author=dirkluijk\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/dirkluijk/ngx-typesafe-forms/commits?author=dirkluijk\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://craftsmen.nl/\"\u003e\u003cimg src=\"https://avatars0.githubusercontent.com/u/16564855?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eDaan Scheerens\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#ideas-dscheerens\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/JurJean\"\u003e\u003cimg src=\"https://avatars1.githubusercontent.com/u/409761?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eJur Balledux\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/dirkluijk/ngx-typesafe-forms/issues?q=author%3AJurJean\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e \u003ca href=\"https://github.com/dirkluijk/ngx-typesafe-forms/commits?author=JurJean\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdirkluijk%2Fngx-typesafe-forms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdirkluijk%2Fngx-typesafe-forms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdirkluijk%2Fngx-typesafe-forms/lists"}