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.
|
||||
*
|
||||
* ```ts
|
||||
* const ctrl = new FormControl('some value');
|
||||
* console.log(ctrl.value); // 'some value'
|
||||
* const control = new FormControl('some value');
|
||||
* console.log(control.value); // 'some value'
|
||||
*```
|
||||
*
|
||||
* The following example initializes the control with a form state object. The `value`
|
||||
* and `disabled` keys are required in this case.
|
||||
*
|
||||
* ```ts
|
||||
* const ctrl = new FormControl({ value: 'n/a', disabled: true });
|
||||
* console.log(ctrl.value); // 'n/a'
|
||||
* console.log(ctrl.status); // 'DISABLED'
|
||||
* const control = new FormControl({ value: 'n/a', disabled: true });
|
||||
* console.log(control.value); // 'n/a'
|
||||
* console.log(control.status); // 'DISABLED'
|
||||
* ```
|
||||
*
|
||||
* The following example initializes the control with a sync validator.
|
||||
*
|
||||
* ```ts
|
||||
* const ctrl = new FormControl('', Validators.required);
|
||||
* console.log(ctrl.value); // ''
|
||||
* console.log(ctrl.status); // 'INVALID'
|
||||
* const control = new FormControl('', Validators.required);
|
||||
* console.log(control.value); // ''
|
||||
* console.log(control.status); // 'INVALID'
|
||||
* ```
|
||||
*
|
||||
* The following example initializes the control using an options object.
|
||||
*
|
||||
* ```ts
|
||||
* const ctrl = new FormControl('', {
|
||||
* const control = new FormControl('', {
|
||||
* validators: Validators.required,
|
||||
* asyncValidators: myAsyncValidator
|
||||
* });
|
||||
|
@ -826,7 +826,7 @@ export abstract class AbstractControl {
|
|||
* Set the `updateOn` option to `'blur'` to update on the blur `event`.
|
||||
*
|
||||
* ```ts
|
||||
* const ctrl = new FormControl('', { updateOn: 'blur' });
|
||||
* const control = new FormControl('', { updateOn: 'blur' });
|
||||
* ```
|
||||
*
|
||||
* ### 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`.
|
||||
*
|
||||
* ```ts
|
||||
* const ctrl = new FormControl('', { updateOn: 'submit' });
|
||||
* const control = new FormControl('', { updateOn: 'submit' });
|
||||
* ```
|
||||
*
|
||||
* ### 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).
|
||||
*
|
||||
* ```ts
|
||||
* const ctrl = new FormControl('Nancy');
|
||||
* const control = new FormControl('Nancy');
|
||||
*
|
||||
* console.log(control.value); // 'Nancy'
|
||||
*
|
||||
|
@ -856,15 +856,15 @@ export abstract class AbstractControl {
|
|||
* ### 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(this.control.status); // 'DISABLED'
|
||||
* console.log(control.status); // 'VALID'
|
||||
*
|
||||
* control.reset({ value: 'Drew', disabled: true });
|
||||
*
|
||||
* console.log(this.control.value); // 'Drew'
|
||||
* console.log(this.control.status); // 'DISABLED'
|
||||
* console.log(control.value); // 'Drew'
|
||||
* console.log(control.status); // 'DISABLED'
|
||||
*
|
||||
*/
|
||||
export class FormControl extends AbstractControl {
|
||||
|
|
Loading…
Reference in New Issue