People are often conflicted when it comes down to forms with Angular. Should we use template-driven forms or reactive forms?
Here’s a simple answer:
- If your form is dynamic (meaning: if the user selects this option, then add/enable or remove/disable other form elements) or will rely on RxJs for reactivity (meaning: auto-complete features or on-the-fly validation of user input using HTTP requests), then use reactive forms.
- In all other scenarios, template-driven forms should be perfectly fine.
That’s it. A bonus for you: If you want to have custom validation of your form, use this tutorial to implement custom validation that works with both template-driven and reactive forms, so you’re not tied to a single option and can still change your mind later on.