What is the difference between reactive and dynamic forms? What i understood regarding dynamic forms is to create the forms dynamically, based on metadata that describes the business object model. I am not clear on this explanation.
-
is it template driven vs reactive? – Aravind Feb 05 '18 at 11:00
-
better read docs about it... – Jai Feb 05 '18 at 11:00
-
https://angular.io/guide/reactive-forms https://angular.io/guide/dynamic-form – mxr7350 Feb 05 '18 at 11:02
-
Possible duplicate of [Angular 2 Reactive Forms vs Template Forms](https://stackoverflow.com/questions/44557477/angular-2-reactive-forms-vs-template-forms) – mxr7350 Feb 05 '18 at 11:04
-
No it is not a duplicate. – Adnan Abdul Khaliq Feb 05 '18 at 11:05
-
With in Reactive forms we can create formGroup dynamically based on the metadata. – Adnan Abdul Khaliq Feb 05 '18 at 11:06
-
Possible duplicate of [What are the practical differences between template-driven and reactive forms?](https://stackoverflow.com/questions/39142616/what-are-the-practical-differences-between-template-driven-and-reactive-forms) – Aravind Feb 05 '18 at 11:10
-
Please refer this qustion. https://stackoverflow.com/questions/39142616/what-are-the-practical-differences-between-template-driven-and-reactive-forms – Ajmal Sha Feb 05 '18 at 11:32
1 Answers
From the docs on Reactive forms
Reactive forms provide a model-driven approach to handling form inputs whose values change over time. This guide shows you how to create and update a simple form control, progress to using multiple controls in a group, validate form values, and implement more advanced forms.
And Dynamic forms...
Building handcrafted forms can be costly and time-consuming, especially if you need a great number of them, they're similar to each other, and they change frequently to meet rapidly changing business and regulatory requirements. It may be more economical to create the forms dynamically, based on metadata that describes the business object model.
So, dynamic forms are created directly from the code in the component. If you're faced with changing requirements and your forms need to constantly change, you can change them without even touching the template. They use reactive forms to work. And reactive forms are a way of describing the form from the component (not the template) so that you can control the validation and the logic associated to it.

- 576
- 6
- 12