adam-dorin / ng-udf

form builder for angular
MIT License
0 stars 0 forks source link

Make form creation automatic #5

Open adam-dorin opened 3 years ago

adam-dorin commented 3 years ago

Description:

Right now the for is created in multiple steps:

  1. call the service with the name and config
  2. start the ng-udf component

Proposed solution

Move the service call inside of the service. Refactor in order to have the behavior separated

  1. Create a class UdfFormBuilder
  2. Transfer to this class(1. ) createForm, setComponents (ng-udf.service) and createGroup ( ng-udf.component)
  3. Add a subscription to formGrup.valueChanges in UdfFormBuilder
  4. Call this class in ng-udf.component and pass the instance to ng-udf.service