Answers for "angular formarray remove all"

2

angular formarray remove all

const arr = new FormArray([
   new FormControl(),
   new FormControl()
]);
console.log(arr.length);  // 2

arr.clear();
console.log(arr.length);  // 0
Posted by: Guest on October-29-2020
0

formarray set value at index

((this.form.get('controls') as FormArray).at(index) as FormGroup).get('description').patchValue(item.description);
Posted by: Guest on August-14-2020
0

how to remove all element from formarray

formArray.clear();
Posted by: Guest on May-10-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language