{"id":15823346,"url":"https://github.com/mat3e/dorf","last_synced_at":"2025-04-01T17:33:15.676Z","repository":{"id":57215260,"uuid":"72996139","full_name":"mat3e/dorf","owner":"mat3e","description":"Domain Object Reactive Forms for Angular and TypeScript","archived":false,"fork":false,"pushed_at":"2018-10-21T18:10:46.000Z","size":882,"stargazers_count":8,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-06T08:07:54.518Z","etag":null,"topics":["angular","annotations","decorators","dynamic-forms","model-driven-development","reactive-forms","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/mat3e.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-11-06T14:30:55.000Z","updated_at":"2020-12-03T09:53:17.000Z","dependencies_parsed_at":"2022-09-07T14:31:49.043Z","dependency_job_id":null,"html_url":"https://github.com/mat3e/dorf","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mat3e%2Fdorf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mat3e%2Fdorf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mat3e%2Fdorf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mat3e%2Fdorf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mat3e","download_url":"https://codeload.github.com/mat3e/dorf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246635945,"owners_count":20809331,"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","annotations","decorators","dynamic-forms","model-driven-development","reactive-forms","typescript"],"created_at":"2024-10-05T08:08:56.281Z","updated_at":"2025-04-01T17:33:15.238Z","avatar_url":"https://github.com/mat3e.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![npm version](https://img.shields.io/npm/v/dorf.svg)](https://www.npmjs.com/package/dorf) [![Build Status](https://travis-ci.org/mat3e/dorf.svg?branch=master)](https://travis-ci.org/mat3e/dorf)\n\n# Domain Object Reactive Forms\nVersion 4 for Angular 5+.\n\nI'm maintaining this library in my free time. But since my son was born in 2017, I have little to no free time :)\n\n### Model-driven forms within the model! \n[**example**](https://stackblitz.com/edit/angular-dorf-example)\n\nAngular's _Reactive Forms_ (a.k.a. _Model-driven Forms_) are great. Then, the dynamic generation of such forms is the next evolution step (sometimes called _Dynamic Forms_). This library is about taking those things to yet another level by coupling forms with _Domain Objects_.\n\n## Want to create a form for an object?\n1. Add some annotations to the object.\n    ```typescript\n    @DorfObject()\n    export class Person {\n        @DorfInput({\n            label: \"Name\", \n            type: \"text\",\n            validator: Validators.required, \n            errorMessage: \"Name is required\",\n            updateModelOnChange: true\n        })\n        name: string;\n\n        @DorfInput({\n            label: \"Surname\", \n            type: \"text\",\n            validator: Validators.required, \n            errorMessage: \"Surname is required\",\n            updateModelOnChange: true\n        })\n        surname: string;\n    }\n    ```\n\n2. Create a _Component_ form which implements `IDorfForm` and uses some annotations. E.g. you should pass the above object as an annotated (`@DorfObjectInput()`) property.\n    ```typescript\n    @DorfForm() // must be above the Component annotation!\n    @Component({\n        selector: \"person-details\"\n        // no template or templateUrl = default one from DORF (!)\n    })\n    export class PersonDetailComponent implements IDorfForm {\n        @DorfObjectInput() domainObject: Person; // has Angular's @Input() behavior as well (!)\n\n        constructor(public config: DorfConfigService) { }\n\n        onDorfSubmit() {\n            let result = this[\"form\"].value;\n            console.log(result);\n        }\n    }\n    ```\n3. You are done! **Really!** Enjoy your _Reactive Form_.\n\n## Detailed tutorials\n* [QuickStart - part I](https://mat3e.github.io/dorf/tutorial/quickstart-1.html)\n* [QuickStart - part II](https://mat3e.github.io/dorf/tutorial/quickstart-2.html)\n* [[wiki] QuickStart - full](https://github.com/mat3e/dorf/wiki/QuickStart)\n\n## Documentation\n[Generated API documentation](https://mat3e.github.io/dorf/api/)\n\n## Vision\nThe aim of this library is to speed up boring things like a creation of the ordinary forms and styling them. Library is not strictly connected with any CSS framework. You can just pass the classes as `DorfConfigService` parameters. \n\nFuture plans include:\n\n - More tests, a nice documentation and step by step tutorial on building with DORF\n - UX improvements - aria support, styles prepared for most common libraries\n - Reactive grids. It is another boring, ordinary thing (and `onSummary` is already presented in the `field definition`)\n - Angular Material module\n - Form arrays\n - Methods for speeding up the creation of custom fields (even more)\n\n### List of the online examples\n - [Simple example](http://embed.plnkr.co/6H2jto/)\n - [Disabled form](http://embed.plnkr.co/a6Z4pb/)\n - [New field example](http://embed.plnkr.co/q4EEDa/)\n - [General example](https://stackblitz.com/edit/angular-dorf-example)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmat3e%2Fdorf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmat3e%2Fdorf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmat3e%2Fdorf/lists"}