Do we have any best examples to create a dynamic forms from the data ? Which input fileds always dynamic. The use case I'm looking for is I have api which is having set of records which always not really consist means today if have 20 record tomrrow may increase upto another 20 ,with this scenario do we have any sort of forks ?
Asked
Active
Viewed 1,153 times
0
-
Are you referring to this: https://angular.io/guide/dynamic-form Or something else? – DeborahK Feb 06 '19 at 02:54
-
Hi,okay, this is my current approach as reactive forms , I built the form with 20 input files as form group and controls for the one record which comes from api which is built on mongo collection ,my record insertion is always dynamic, today I built a form with 20 records ,but tomorrow if the new record comes with more or less I have to populate the form .with my current approach is static which means when ever new record eitj new fileds are inserted I need to tweak my form code to render the values. so with this what is the best way to achieve dynamic forms. Appreciate if you have any magic. – vijay munnangi Feb 06 '19 at 03:53
1 Answers
1
We use the ngx-formly module for rendering forms using json schema. It is a very vast library with awesome community support and a whole lot of features. You just need to pass your json schema in a specific format and the form will be rendered with all validations.
https://github.com/ngx-formly/ngx-formly GitHub - ngx-formly/ngx-formly: JSON powered / Dynamic forms

Prasheel
- 985
- 5
- 22
-
Thank you much prasheel,gald that I got it on time , does this works with mat dialog Data?. Meaning I have two components , component A renders the table data from api and component B servers larger part of records in dialog form . – vijay munnangi Feb 06 '19 at 03:37
-