docs(forms): fix incorrect variables naming in the comments (#25150)
PR Close #25150
This commit is contained in:
parent
5254d3447d
commit
3f6fc00d73
|
@ -791,31 +791,31 @@ export abstract class AbstractControl {
|
||||||
* Instantiate a `FormControl`, with an initial value.
|
* Instantiate a `FormControl`, with an initial value.
|
||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* const ctrl = new FormControl('some value');
|
* const control = new FormControl('some value');
|
||||||
* console.log(ctrl.value); // 'some value'
|
* console.log(control.value); // 'some value'
|
||||||
*```
|
*```
|
||||||
*
|
*
|
||||||
* The following example initializes the control with a form state object. The `value`
|
* The following example initializes the control with a form state object. The `value`
|
||||||
* and `disabled` keys are required in this case.
|
* and `disabled` keys are required in this case.
|
||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* const ctrl = new FormControl({ value: 'n/a', disabled: true });
|
* const control = new FormControl({ value: 'n/a', disabled: true });
|
||||||
* console.log(ctrl.value); // 'n/a'
|
* console.log(control.value); // 'n/a'
|
||||||
* console.log(ctrl.status); // 'DISABLED'
|
* console.log(control.status); // 'DISABLED'
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* The following example initializes the control with a sync validator.
|
* The following example initializes the control with a sync validator.
|
||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* const ctrl = new FormControl('', Validators.required);
|
* const control = new FormControl('', Validators.required);
|
||||||
* console.log(ctrl.value); // ''
|
* console.log(control.value); // ''
|
||||||
* console.log(ctrl.status); // 'INVALID'
|
* console.log(control.status); // 'INVALID'
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* The following example initializes the control using an options object.
|
* The following example initializes the control using an options object.
|
||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* const ctrl = new FormControl('', {
|
* const control = new FormControl('', {
|
||||||
* validators: Validators.required,
|
* validators: Validators.required,
|
||||||
* asyncValidators: myAsyncValidator
|
* asyncValidators: myAsyncValidator
|
||||||
* });
|
* });
|
||||||
|
@ -826,7 +826,7 @@ export abstract class AbstractControl {
|
||||||
* Set the `updateOn` option to `'blur'` to update on the blur `event`.
|
* Set the `updateOn` option to `'blur'` to update on the blur `event`.
|
||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* const ctrl = new FormControl('', { updateOn: 'blur' });
|
* const control = new FormControl('', { updateOn: 'blur' });
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* ### Configure the control to update on a submit event
|
* ### Configure the control to update on a submit event
|
||||||
|
@ -834,7 +834,7 @@ export abstract class AbstractControl {
|
||||||
* Set the `updateOn` option to `'submit'` to update on a submit `event`.
|
* Set the `updateOn` option to `'submit'` to update on a submit `event`.
|
||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* const ctrl = new FormControl('', { updateOn: 'submit' });
|
* const control = new FormControl('', { updateOn: 'submit' });
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* ### Reset the control back to an initial value
|
* ### Reset the control back to an initial value
|
||||||
|
@ -844,7 +844,7 @@ export abstract class AbstractControl {
|
||||||
* (these are the only two properties that cannot be calculated).
|
* (these are the only two properties that cannot be calculated).
|
||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* const ctrl = new FormControl('Nancy');
|
* const control = new FormControl('Nancy');
|
||||||
*
|
*
|
||||||
* console.log(control.value); // 'Nancy'
|
* console.log(control.value); // 'Nancy'
|
||||||
*
|
*
|
||||||
|
@ -856,15 +856,15 @@ export abstract class AbstractControl {
|
||||||
* ### Reset the control back to an initial value and disabled
|
* ### Reset the control back to an initial value and disabled
|
||||||
*
|
*
|
||||||
* ```
|
* ```
|
||||||
* const ctrl = new FormControl('Nancy');
|
* const control = new FormControl('Nancy');
|
||||||
*
|
*
|
||||||
* console.log(control.value); // 'Nancy'
|
* console.log(control.value); // 'Nancy'
|
||||||
* console.log(this.control.status); // 'DISABLED'
|
* console.log(control.status); // 'VALID'
|
||||||
*
|
*
|
||||||
* control.reset({ value: 'Drew', disabled: true });
|
* control.reset({ value: 'Drew', disabled: true });
|
||||||
*
|
*
|
||||||
* console.log(this.control.value); // 'Drew'
|
* console.log(control.value); // 'Drew'
|
||||||
* console.log(this.control.status); // 'DISABLED'
|
* console.log(control.status); // 'DISABLED'
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
export class FormControl extends AbstractControl {
|
export class FormControl extends AbstractControl {
|
||||||
|
|
Loading…
Reference in New Issue