The advantage of a template-driven design is its simplicity. There will be little code in the controller. Most logic happens in a template. This is suitable for simple forms that do not require much logic for html code.
But each form has a state that can be updated by many different interactions, and up to the application developer to manage this state and prevent its damage. This can be difficult to do for very large forms and can introduce errors.
On the other hand, if more logic is required, testing is often required. Then the jet model driven design offers more. We can perform a single validation of the form validation logic. We can do this by creating an instance of the class, setting some values ββin the form controls and conducting tests. For complex software, this is absolutely essential for design and maintainability. A design flaw with a reactive model is its complexity.
There is also a way to mix both types of design, but this will have disadvantages of both types.
This is explained with a simple code example for both ways: Introduction to Angular Forms - Driven Template vs Model Driven or Reactive Forms
Bert verhees
source share