docs(forms): correct sample code for FormArray.reset (#42477)

Remove unexpected this, correct output comment for arr.value and correct parameter type for FormArray.get().

PR Close #42477
This commit is contained in:
Marius Bethge 2021-06-04 15:10:18 +01:00 committed by Alex Rickabaugh
parent 62aca30286
commit f3a79878af

View File

@ -2091,19 +2091,19 @@ export class FormArray extends AbstractControl {
* ]); * ]);
* arr.reset(['name', 'last name']); * arr.reset(['name', 'last name']);
* *
* console.log(this.arr.value); // ['name', 'last name'] * console.log(arr.value); // ['name', 'last name']
* ``` * ```
* *
* ### Reset the values in a form array and the disabled status for the first control * ### Reset the values in a form array and the disabled status for the first control
* *
* ``` * ```
* this.arr.reset([ * arr.reset([
* {value: 'name', disabled: true}, * {value: 'name', disabled: true},
* 'last' * 'last'
* ]); * ]);
* *
* console.log(this.arr.value); // ['name', 'last name'] * console.log(arr.value); // ['last']
* console.log(this.arr.get(0).status); // 'DISABLED' * console.log(arr.at(0).status); // 'DISABLED'
* ``` * ```
* *
* @param value Array of values for the controls * @param value Array of values for the controls