https://github.com/angular-ru/angular-reactive-forms-starter
https://github.com/angular-ru/angular-reactive-forms-starter
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/angular-ru/angular-reactive-forms-starter
- Owner: Angular-RU
- Created: 2018-07-02T10:43:00.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-07-02T12:04:33.000Z (almost 7 years ago)
- Last Synced: 2025-01-24T15:29:06.857Z (5 months ago)
- Language: TypeScript
- Size: 99.6 KB
- Stars: 1
- Watchers: 5
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Angular Reactive Forms Starter
## Installation
For angular 6:
```bash
$ git clone https://github.com/Angular-RU/angular-reactive-forms-starter.git
$ cd angular-reactive-forms-starter
$ npm i
$ npm start
```## Description

### You have:
1. `MainComponent` - Component at the top of the form.
2. `FormService` - Service, you can use for parsing or converting `Model`<=>`Form`
3. `NestedComponents` - Dummy components. Their main mission is to bind form controls to elements in the template. If needed you can inject `FormsService` and use it to generate new `FormGroup` in `FormArray` etc.## Principles
1. `NestedComponents` **must** be stupid! Only some validators declatations, subscribtions on changing, without strong logic
2. You should cover `FormsService` with unit tests.
3. You can move some transformation parts from `FormsService` to more convinient places.
> *For example*:
>
> Transformation logic, related to `ThirdStepComponent` can be in `ThirdStepService` in same folder.## Things to do:
We want to create transforming package, which will be able convert json directly to form and visa versa.
Without any middle form<->model and model<->json, transformations