{"id":18614961,"url":"https://github.com/andrewjbateman/ionic-api-techdata","last_synced_at":"2026-04-18T02:09:56.715Z","repository":{"id":39543334,"uuid":"162578735","full_name":"AndrewJBateman/ionic-api-techdata","owner":"AndrewJBateman","description":":clipboard: Displays a reactive form with controls defined in a JSON file. Code from Josh Morony.","archived":false,"fork":false,"pushed_at":"2023-07-19T07:11:40.000Z","size":3160,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-27T02:45:10.399Z","etag":null,"topics":["angular","angular16","capacitor","html5","ionic","ionic7","json-data","reactive-forms","scss-framework"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AndrewJBateman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-12-20T12:47:17.000Z","updated_at":"2023-10-06T07:28:38.000Z","dependencies_parsed_at":"2024-11-07T03:31:10.220Z","dependency_job_id":"b501d1b5-6ff1-4b35-bce6-e7925e1e3cea","html_url":"https://github.com/AndrewJBateman/ionic-api-techdata","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fionic-api-techdata","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fionic-api-techdata/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fionic-api-techdata/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fionic-api-techdata/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AndrewJBateman","download_url":"https://codeload.github.com/AndrewJBateman/ionic-api-techdata/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239406450,"owners_count":19633024,"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","angular16","capacitor","html5","ionic","ionic7","json-data","reactive-forms","scss-framework"],"created_at":"2024-11-07T03:27:39.052Z","updated_at":"2025-11-03T03:30:31.894Z","avatar_url":"https://github.com/AndrewJBateman.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# :zap: Ionic API TechData\n\n* Displays a reactive form with controls defined in a JSON file\n* Code from [Joshua Morony](https://www.youtube.com/channel/UCbVZdLngJH6KOJvpAOO3qTw) - see [:clap: Inspiration](#clap-inspiration) below\n* **Note:** to open web links in a new window use: _ctrl+click on link_\n\n![GitHub repo size](https://img.shields.io/github/repo-size/AndrewJBateman/ionic-api-techdata?style=plastic)\n![GitHub pull requests](https://img.shields.io/github/issues-pr/AndrewJBateman/ionic-api-techdata?style=plastic)\n![GitHub Repo stars](https://img.shields.io/github/stars/AndrewJBateman/ionic-api-techdata?style=plastic)\n![GitHub last commit](https://img.shields.io/github/last-commit/AndrewJBateman/ionic-api-techdata?style=plastic)\n\n## :page_facing_up: Table of contents\n\n* [:zap: Ionic API TechData](#zap-ionic-api-techdata)\n  * [:page\\_facing\\_up: Table of contents](#page_facing_up-table-of-contents)\n  * [:books: General info](#books-general-info)\n  * [:camera: Screenshots](#camera-screenshots)\n  * [:signal\\_strength: Technologies](#signal_strength-technologies)\n  * [:floppy\\_disk: Setup](#floppy_disk-setup)\n  * [:computer: Code Examples](#computer-code-examples)\n  * [:cool: Features](#cool-features)\n  * [:clipboard: Status \\\u0026 To-do list](#clipboard-status--to-do-list)\n  * [:clap: Inspiration](#clap-inspiration)\n  * [:file\\_folder: License](#file_folder-license)\n  * [:envelope: Contact](#envelope-contact)\n\n## :books: General info\n\n* [Angular ChangeDetectionStrategy](https://angular.io/api/core/ChangeDetectionStrategy) set to OnPush, so automatic change detection set to off.\n\n## :camera: Screenshots\n\n![techData screen print](./img/form.png)\n\n## :signal_strength: Technologies\n\n* [Ionic/angular v7](https://ionicframework.com/)\n* [Ionic v7](https://ionicframework.com/)\n* [Angular v16](https://angular.io/)\n* [Reactive Forms](https://angular.io/guide/reactive-forms) model-driven approach to handling form inputs whose values change over time.\n* [Transform.Tools](https://transform.tools/) online data format conversion\n\n## :floppy_disk: Setup\n\n* Load dependencies using `npm i`,\n* To start the server on _localhost://8100_ type: 'ionic serve'\n\n## :computer: Code Examples\n\n* `json-form.component.ts` method to create a form from the `data-form.json` values\n\n```typescript\n  createForm(controls: IJsonFormControls[]) {\n    for (const control of controls) {\n      const validatorsToAdd = [];\n\n      for (const [key, value] of Object.entries(control.validators)) {\n        switch (key) {\n          case 'min':\n            validatorsToAdd.push(Validators.min(value));\n            break;\n          case 'max':\n            validatorsToAdd.push(Validators.max(value));\n            break;\n          case 'required':\n            if (value) {\n              validatorsToAdd.push(Validators.required);\n            }\n            break;\n          case 'requiredTrue':\n            if (value) {\n              validatorsToAdd.push(Validators.requiredTrue);\n            }\n            break;\n          case 'email':\n            if (value) {\n              validatorsToAdd.push(Validators.email);\n            }\n            break;\n          case 'minLength':\n            validatorsToAdd.push(Validators.minLength(value));\n            break;\n          case 'maxLength':\n            validatorsToAdd.push(Validators.maxLength(value));\n            break;\n          case 'pattern':\n            validatorsToAdd.push(Validators.pattern(value));\n            break;\n          case 'nullValidator':\n            if (value) {\n              validatorsToAdd.push(Validators.nullValidator);\n            }\n            break;\n          default:\n            break;\n        }\n      }\n\n      this.dataForm.addControl(\n        control.name,\n        this.fb.control(control.value, validatorsToAdd)\n      );\n    }\n    console.log('data form: ', this.dataForm);\n  }\n```\n\n## :cool: Features\n\n* Defines reactive form controls from a JSON file\n\n## :clipboard: Status \u0026 To-do list\n\n* Status: Working\n* To-do: Nothing\n\n## :clap: Inspiration\n\n* [Josh Morony: Create a Dynamic Reactive Angular Form with JSON](https://www.youtube.com/watch?v=ByHw_RMjkKM\u0026t=48s)\n\n## :file_folder: License\n\n* N/A\n\n## :envelope: Contact\n\n* Repo created by [ABateman](https://github.com/AndrewJBateman), email: `gomezbateman@yahoo.com`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewjbateman%2Fionic-api-techdata","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrewjbateman%2Fionic-api-techdata","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewjbateman%2Fionic-api-techdata/lists"}