You are building a dynamic form where users can add or remove input fields. Which feature or approach in Angular would be best suited for this requirement?

  • FormArray
  • Reactive Forms
  • Template-driven Forms
  • ngFor Directive
To allow users to add or remove input fields dynamically, you would typically use the FormArray feature in Angular. FormArray allows you to create arrays of form controls dynamically, making it ideal for scenarios where the number of input fields can change. Reactive Forms provide a more robust way to manage form data compared to Template-driven Forms, and ngFor is a directive used for rendering lists but doesn't handle form controls.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *