Bird
0
0

Which of the following is the correct way to add a new control to a FormArray named emails?

easy📝 Syntax Q12 of 15
Angular - Reactive Forms
Which of the following is the correct way to add a new control to a FormArray named emails?
Aemails.insertControl(new FormControl(''))
Bemails.addControl(new FormControl(''))
Cemails.push(new FormControl(''))
Demails.appendControl(new FormControl(''))
Step-by-Step Solution
Solution:
  1. Step 1: Recall FormArray methods

    The method to add a control to FormArray is push().
  2. Step 2: Check each option

    Only emails.push(new FormControl('')) uses push() correctly. Others are invalid methods for FormArray.
  3. Final Answer:

    emails.push(new FormControl('')) -> Option C
  4. Quick Check:

    Use push() to add control [OK]
Quick Trick: Use push() to add controls to FormArray [OK]
Common Mistakes:
MISTAKES
  • Using addControl() which is for FormGroup
  • Trying appendControl() or insertControl() which don't exist
  • Confusing FormArray with FormGroup methods

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes