Complete the code to import the FormArray class from Angular forms.
import { FormGroup, FormControl, [1] } from '@angular/forms';
The FormArray class is imported from @angular/forms to create dynamic form controls.
Complete the code to create a FormArray inside a FormGroup named 'skills'.
this.form = new FormGroup({ skills: new [1]([]) });Use FormArray to hold a dynamic list of form controls inside the form group.
Fix the error in adding a new FormControl to the FormArray named 'skills'.
this.form.get('skills').[1](new FormControl(''));
The FormArray uses the push method to add new controls dynamically.
Fill both blanks to get the FormArray 'skills' and add a new FormControl with empty string.
const skillsArray = this.form.get('[1]') as [2]; skillsArray.push(new FormControl(''));
Use get('skills') to access the FormArray and cast it as FormArray to use push.
Fill all three blanks to create a FormArray with two FormControls initialized with 'Angular' and 'TypeScript'.
this.form = new FormGroup({ skills: new [1]([new FormControl('[2]'), new FormControl('[3]')]) });Create a FormArray with two FormControl instances initialized with 'Angular' and 'TypeScript'.