For angular 6:
$ git clone https://github.com/Angular-RU/angular-reactive-forms-starter.git
$ cd angular-reactive-forms-starter
$ npm i
$ npm startMainComponent- Component at the top of the form.FormService- Service, you can use for parsing or convertingModel<=>FormNestedComponents- Dummy components. Their main mission is to bind form controls to elements in the template. If needed you can injectFormsServiceand use it to generate newFormGroupinFormArrayetc.
NestedComponentsmust be stupid! Only some validators declatations, subscribtions on changing, without strong logic- You should cover
FormsServicewith unit tests. - You can move some transformation parts from
FormsServiceto more convinient places.
For example:
Transformation logic, related to
ThirdStepComponentcan be inThirdStepServicein same folder.
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
