@angular/forms 21.0.0-next.0 → 21.0.0-next.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/forms.mjs +4852 -7211
- package/fesm2022/forms.mjs.map +1 -1
- package/fesm2022/signals.mjs +2056 -0
- package/fesm2022/signals.mjs.map +1 -0
- package/package.json +11 -6
- package/{index.d.ts → types/forms.d.ts} +164 -56
- package/types/signals.d.ts +2725 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v21.0.0-next.
|
|
3
|
-
* (c) 2010-2025 Google LLC. https://angular.
|
|
2
|
+
* @license Angular v21.0.0-next.10
|
|
3
|
+
* (c) 2010-2025 Google LLC. https://angular.dev/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -1100,6 +1100,8 @@ declare class FormArray<TControl extends AbstractControl<any> = any> extends Abs
|
|
|
1100
1100
|
* * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and
|
|
1101
1101
|
* `valueChanges` observables emit events with the latest status and value when the control is
|
|
1102
1102
|
* inserted. When false, no events are emitted.
|
|
1103
|
+
*
|
|
1104
|
+
* NOTE: Pushing to the FormArray will not mark it dirty. If you want to mark if dirty, call `markAsDirty()`.
|
|
1103
1105
|
*/
|
|
1104
1106
|
push(control: TControl | Array<TControl>, options?: {
|
|
1105
1107
|
emitEvent?: boolean;
|
|
@@ -1116,6 +1118,8 @@ declare class FormArray<TControl extends AbstractControl<any> = any> extends Abs
|
|
|
1116
1118
|
* * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and
|
|
1117
1119
|
* `valueChanges` observables emit events with the latest status and value when the control is
|
|
1118
1120
|
* inserted. When false, no events are emitted.
|
|
1121
|
+
*
|
|
1122
|
+
* NOTE: Inserting to the FormArray will not mark it dirty. If you want to mark if dirty, call `markAsDirty()`.
|
|
1119
1123
|
*/
|
|
1120
1124
|
insert(index: number, control: TControl, options?: {
|
|
1121
1125
|
emitEvent?: boolean;
|
|
@@ -1131,6 +1135,8 @@ declare class FormArray<TControl extends AbstractControl<any> = any> extends Abs
|
|
|
1131
1135
|
* * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and
|
|
1132
1136
|
* `valueChanges` observables emit events with the latest status and value when the control is
|
|
1133
1137
|
* removed. When false, no events are emitted.
|
|
1138
|
+
*
|
|
1139
|
+
* NOTE: Removing the FormArray will not mark it dirty. If you want to mark if dirty, call `markAsDirty()`.
|
|
1134
1140
|
*/
|
|
1135
1141
|
removeAt(index: number, options?: {
|
|
1136
1142
|
emitEvent?: boolean;
|
|
@@ -1279,6 +1285,7 @@ declare class FormArray<TControl extends AbstractControl<any> = any> extends Abs
|
|
|
1279
1285
|
reset(value?: ɵTypedOrUntyped<TControl, ɵFormArrayValue<TControl>, any>, options?: {
|
|
1280
1286
|
onlySelf?: boolean;
|
|
1281
1287
|
emitEvent?: boolean;
|
|
1288
|
+
overwriteDefaultValue?: boolean;
|
|
1282
1289
|
}): void;
|
|
1283
1290
|
/**
|
|
1284
1291
|
* The aggregate value of the array, including any disabled controls.
|
|
@@ -1345,6 +1352,8 @@ declare const UntypedFormArray: UntypedFormArrayCtor;
|
|
|
1345
1352
|
* @description
|
|
1346
1353
|
* Asserts that the given control is an instance of `FormArray`
|
|
1347
1354
|
*
|
|
1355
|
+
* @see [Utility functions for narrowing form control types](guide/forms/reactive-forms#utility-functions-for-narrowing-form-control-types)
|
|
1356
|
+
*
|
|
1348
1357
|
* @publicApi
|
|
1349
1358
|
*/
|
|
1350
1359
|
declare const isFormArray: (control: unknown) => control is FormArray;
|
|
@@ -1577,7 +1586,7 @@ interface FormControl<TValue = any> extends AbstractControl<TValue> {
|
|
|
1577
1586
|
* value. See {@link FormControlOptions#nonNullable} for more information on configuring
|
|
1578
1587
|
* a default value.
|
|
1579
1588
|
*/
|
|
1580
|
-
|
|
1589
|
+
defaultValue: TValue;
|
|
1581
1590
|
/**
|
|
1582
1591
|
* Sets a new value for the form control.
|
|
1583
1592
|
*
|
|
@@ -1653,11 +1662,13 @@ interface FormControl<TValue = any> extends AbstractControl<TValue> {
|
|
|
1653
1662
|
* `valueChanges`
|
|
1654
1663
|
* observables emit events with the latest status and value when the control is reset.
|
|
1655
1664
|
* When false, no events are emitted.
|
|
1665
|
+
* * `overwriteDefaultValue`: When true, the value used to reset the control becomes the new default value of the control.
|
|
1656
1666
|
*
|
|
1657
1667
|
*/
|
|
1658
1668
|
reset(formState?: TValue | FormControlState<TValue>, options?: {
|
|
1659
1669
|
onlySelf?: boolean;
|
|
1660
1670
|
emitEvent?: boolean;
|
|
1671
|
+
overwriteDefaultValue?: boolean;
|
|
1661
1672
|
}): void;
|
|
1662
1673
|
/**
|
|
1663
1674
|
* For a simple FormControl, the raw value is equivalent to the value.
|
|
@@ -1695,6 +1706,8 @@ declare const UntypedFormControl: UntypedFormControlCtor;
|
|
|
1695
1706
|
* @description
|
|
1696
1707
|
* Asserts that the given control is an instance of `FormControl`
|
|
1697
1708
|
*
|
|
1709
|
+
* @see [Utility functions for narrowing form control types](guide/forms/reactive-forms#utility-functions-for-narrowing-form-control-types)
|
|
1710
|
+
*
|
|
1698
1711
|
* @publicApi
|
|
1699
1712
|
*/
|
|
1700
1713
|
declare const isFormControl: (control: unknown) => control is FormControl;
|
|
@@ -2093,6 +2106,7 @@ declare class FormGroup<TControl extends {
|
|
|
2093
2106
|
reset(value?: ɵTypedOrUntyped<TControl, ɵFormGroupArgumentValue<TControl>, any>, options?: {
|
|
2094
2107
|
onlySelf?: boolean;
|
|
2095
2108
|
emitEvent?: boolean;
|
|
2109
|
+
overwriteDefaultValue?: boolean;
|
|
2096
2110
|
}): void;
|
|
2097
2111
|
/**
|
|
2098
2112
|
* The aggregate value of the `FormGroup`, including any disabled controls.
|
|
@@ -2120,6 +2134,8 @@ declare const UntypedFormGroup: UntypedFormGroupCtor;
|
|
|
2120
2134
|
* @description
|
|
2121
2135
|
* Asserts that the given control is an instance of `FormGroup`
|
|
2122
2136
|
*
|
|
2137
|
+
* @see [Utility functions for narrowing form control types](guide/forms/reactive-forms#utility-functions-for-narrowing-form-control-types)
|
|
2138
|
+
*
|
|
2123
2139
|
* @publicApi
|
|
2124
2140
|
*/
|
|
2125
2141
|
declare const isFormGroup: (control: unknown) => control is FormGroup;
|
|
@@ -2233,6 +2249,8 @@ interface FormRecord<TControl> {
|
|
|
2233
2249
|
* @description
|
|
2234
2250
|
* Asserts that the given control is an instance of `FormRecord`
|
|
2235
2251
|
*
|
|
2252
|
+
* @see [Utility functions for narrowing form control types](guide/forms/reactive-forms#utility-functions-for-narrowing-form-control-types)
|
|
2253
|
+
*
|
|
2236
2254
|
* @publicApi
|
|
2237
2255
|
*/
|
|
2238
2256
|
declare const isFormRecord: (control: unknown) => control is FormRecord;
|
|
@@ -2269,6 +2287,8 @@ declare abstract class ControlEvent<T = any> {
|
|
|
2269
2287
|
/**
|
|
2270
2288
|
* Event fired when the value of a control changes.
|
|
2271
2289
|
*
|
|
2290
|
+
* @see {@link AbstractControl.events}
|
|
2291
|
+
*
|
|
2272
2292
|
* @publicApi
|
|
2273
2293
|
*/
|
|
2274
2294
|
declare class ValueChangeEvent<T> extends ControlEvent<T> {
|
|
@@ -2279,6 +2299,8 @@ declare class ValueChangeEvent<T> extends ControlEvent<T> {
|
|
|
2279
2299
|
/**
|
|
2280
2300
|
* Event fired when the control's pristine state changes (pristine <=> dirty).
|
|
2281
2301
|
*
|
|
2302
|
+
* @see {@link AbstractControl.events}
|
|
2303
|
+
*
|
|
2282
2304
|
* @publicApi */
|
|
2283
2305
|
declare class PristineChangeEvent extends ControlEvent {
|
|
2284
2306
|
readonly pristine: boolean;
|
|
@@ -2288,6 +2310,8 @@ declare class PristineChangeEvent extends ControlEvent {
|
|
|
2288
2310
|
/**
|
|
2289
2311
|
* Event fired when the control's touched status changes (touched <=> untouched).
|
|
2290
2312
|
*
|
|
2313
|
+
* @see {@link AbstractControl.events}
|
|
2314
|
+
*
|
|
2291
2315
|
* @publicApi
|
|
2292
2316
|
*/
|
|
2293
2317
|
declare class TouchedChangeEvent extends ControlEvent {
|
|
@@ -2298,6 +2322,8 @@ declare class TouchedChangeEvent extends ControlEvent {
|
|
|
2298
2322
|
/**
|
|
2299
2323
|
* Event fired when the control's status changes.
|
|
2300
2324
|
*
|
|
2325
|
+
* @see {@link AbstractControl.events}
|
|
2326
|
+
*
|
|
2301
2327
|
* @publicApi
|
|
2302
2328
|
*/
|
|
2303
2329
|
declare class StatusChangeEvent extends ControlEvent {
|
|
@@ -2308,6 +2334,8 @@ declare class StatusChangeEvent extends ControlEvent {
|
|
|
2308
2334
|
/**
|
|
2309
2335
|
* Event fired when a form is submitted
|
|
2310
2336
|
*
|
|
2337
|
+
* @see {@link AbstractControl.events}
|
|
2338
|
+
*
|
|
2311
2339
|
* @publicApi
|
|
2312
2340
|
*/
|
|
2313
2341
|
declare class FormSubmittedEvent extends ControlEvent {
|
|
@@ -2317,6 +2345,8 @@ declare class FormSubmittedEvent extends ControlEvent {
|
|
|
2317
2345
|
/**
|
|
2318
2346
|
* Event fired when a form is reset.
|
|
2319
2347
|
*
|
|
2348
|
+
* @see {@link AbstractControl.events}
|
|
2349
|
+
*
|
|
2320
2350
|
* @publicApi
|
|
2321
2351
|
*/
|
|
2322
2352
|
declare class FormResetEvent extends ControlEvent {
|
|
@@ -2635,6 +2665,7 @@ declare abstract class AbstractControl<TValue = any, TRawValue extends TValue =
|
|
|
2635
2665
|
* `events` of the parent control instead.
|
|
2636
2666
|
* For other event types, the events are emitted after the parent control has been updated.
|
|
2637
2667
|
*
|
|
2668
|
+
* @see [Unified control state change events](guide/forms/reactive-forms#unified-control-state-change-events)
|
|
2638
2669
|
*/
|
|
2639
2670
|
readonly events: Observable<ControlEvent<TValue>>;
|
|
2640
2671
|
/**
|
|
@@ -3028,6 +3059,8 @@ declare abstract class AbstractControl<TValue = any, TRawValue extends TValue =
|
|
|
3028
3059
|
*
|
|
3029
3060
|
* Calling `setErrors` also updates the validity of the parent control.
|
|
3030
3061
|
*
|
|
3062
|
+
* Note: Manually set errors are always overwritten by the results of the next validation run.
|
|
3063
|
+
*
|
|
3031
3064
|
* @param opts Configuration options that determine how the control propagates
|
|
3032
3065
|
* changes and emits events after the control errors are set.
|
|
3033
3066
|
* * `emitEvent`: When true or not supplied (the default), the `statusChanges`
|
|
@@ -3643,7 +3676,7 @@ declare class NgControlStatus extends AbstractControlStatus {
|
|
|
3643
3676
|
declare class NgControlStatusGroup extends AbstractControlStatus {
|
|
3644
3677
|
constructor(cd: ControlContainer);
|
|
3645
3678
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgControlStatusGroup, [{ optional: true; self: true; }]>;
|
|
3646
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<NgControlStatusGroup, "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]", never, {}, {}, never, never, false, never>;
|
|
3679
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NgControlStatusGroup, "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]", never, {}, {}, never, never, false, never>;
|
|
3647
3680
|
}
|
|
3648
3681
|
|
|
3649
3682
|
/**
|
|
@@ -3736,28 +3769,12 @@ declare class FormControlName extends NgControl implements OnChanges, OnDestroy
|
|
|
3736
3769
|
/**
|
|
3737
3770
|
* @description
|
|
3738
3771
|
*
|
|
3739
|
-
*
|
|
3740
|
-
*
|
|
3741
|
-
* This directive accepts an existing `FormGroup` instance. It will then use this
|
|
3742
|
-
* `FormGroup` instance to match any child `FormControl`, `FormGroup`/`FormRecord`,
|
|
3743
|
-
* and `FormArray` instances to child `FormControlName`, `FormGroupName`,
|
|
3744
|
-
* and `FormArrayName` directives.
|
|
3745
|
-
*
|
|
3746
|
-
* @see [Reactive Forms Guide](guide/forms/reactive-forms)
|
|
3747
|
-
* @see {@link AbstractControl}
|
|
3748
|
-
*
|
|
3749
|
-
* @usageNotes
|
|
3750
|
-
* ### Register Form Group
|
|
3751
|
-
*
|
|
3752
|
-
* The following example registers a `FormGroup` with first name and last name controls,
|
|
3753
|
-
* and listens for the *ngSubmit* event when the button is clicked.
|
|
3772
|
+
* Abstract class for top-level form directives (FormArrayDirective, FormGroupDirective) who bind an
|
|
3773
|
+
* existing `Form` to a DOM element.
|
|
3754
3774
|
*
|
|
3755
|
-
* {@example forms/ts/simpleFormGroup/simple_form_group_example.ts region='Component'}
|
|
3756
|
-
*
|
|
3757
|
-
* @ngModule ReactiveFormsModule
|
|
3758
3775
|
* @publicApi
|
|
3759
3776
|
*/
|
|
3760
|
-
declare class
|
|
3777
|
+
declare abstract class AbstractFormDirective extends ControlContainer implements Form, OnChanges, OnDestroy {
|
|
3761
3778
|
private callSetDisabledState?;
|
|
3762
3779
|
/**
|
|
3763
3780
|
* @description
|
|
@@ -3783,19 +3800,23 @@ declare class FormGroupDirective extends ControlContainer implements Form, OnCha
|
|
|
3783
3800
|
directives: FormControlName[];
|
|
3784
3801
|
/**
|
|
3785
3802
|
* @description
|
|
3786
|
-
* Tracks the
|
|
3803
|
+
* Tracks the form bound to this directive.
|
|
3787
3804
|
*/
|
|
3788
|
-
form:
|
|
3805
|
+
abstract form: AbstractControl;
|
|
3789
3806
|
/**
|
|
3790
3807
|
* @description
|
|
3791
3808
|
* Emits an event when the form submission has been triggered.
|
|
3792
3809
|
*/
|
|
3793
|
-
ngSubmit: EventEmitter<any>;
|
|
3810
|
+
abstract ngSubmit: EventEmitter<any>;
|
|
3794
3811
|
constructor(validators: (Validator | ValidatorFn)[], asyncValidators: (AsyncValidator | AsyncValidatorFn)[], callSetDisabledState?: SetDisabledStateOption | undefined);
|
|
3795
|
-
/** @
|
|
3812
|
+
/** @nodoc */
|
|
3796
3813
|
ngOnChanges(changes: SimpleChanges): void;
|
|
3797
|
-
/** @
|
|
3814
|
+
/** @nodoc */
|
|
3798
3815
|
ngOnDestroy(): void;
|
|
3816
|
+
/** @nodoc */
|
|
3817
|
+
protected onChanges(changes: SimpleChanges): void;
|
|
3818
|
+
/** @nodoc */
|
|
3819
|
+
protected onDestroy(): void;
|
|
3799
3820
|
/**
|
|
3800
3821
|
* @description
|
|
3801
3822
|
* Returns this directive's instance.
|
|
@@ -3803,9 +3824,9 @@ declare class FormGroupDirective extends ControlContainer implements Form, OnCha
|
|
|
3803
3824
|
get formDirective(): Form;
|
|
3804
3825
|
/**
|
|
3805
3826
|
* @description
|
|
3806
|
-
* Returns the
|
|
3827
|
+
* Returns the Form bound to this directive.
|
|
3807
3828
|
*/
|
|
3808
|
-
get control():
|
|
3829
|
+
abstract get control(): AbstractControl;
|
|
3809
3830
|
/**
|
|
3810
3831
|
* @description
|
|
3811
3832
|
* Returns an array representing the path to this group. Because this directive
|
|
@@ -3854,6 +3875,13 @@ declare class FormGroupDirective extends ControlContainer implements Form, OnCha
|
|
|
3854
3875
|
* @param dir The `FormGroupName` directive instance.
|
|
3855
3876
|
*/
|
|
3856
3877
|
getFormGroup(dir: FormGroupName): FormGroup;
|
|
3878
|
+
/**
|
|
3879
|
+
* @description
|
|
3880
|
+
* Retrieves the `FormArray` for a provided `FormArrayName` directive instance.
|
|
3881
|
+
*
|
|
3882
|
+
* @param dir The `FormArrayName` directive instance.
|
|
3883
|
+
*/
|
|
3884
|
+
getFormArray(dir: FormArrayName): FormArray;
|
|
3857
3885
|
/**
|
|
3858
3886
|
* Performs the necessary setup when a `FormArrayName` directive instance is added to the view.
|
|
3859
3887
|
*
|
|
@@ -3867,13 +3895,6 @@ declare class FormGroupDirective extends ControlContainer implements Form, OnCha
|
|
|
3867
3895
|
* @param dir The `FormArrayName` directive instance.
|
|
3868
3896
|
*/
|
|
3869
3897
|
removeFormArray(dir: FormArrayName): void;
|
|
3870
|
-
/**
|
|
3871
|
-
* @description
|
|
3872
|
-
* Retrieves the `FormArray` for a provided `FormArrayName` directive instance.
|
|
3873
|
-
*
|
|
3874
|
-
* @param dir The `FormArrayName` directive instance.
|
|
3875
|
-
*/
|
|
3876
|
-
getFormArray(dir: FormArrayName): FormArray;
|
|
3877
3898
|
/**
|
|
3878
3899
|
* Sets the new value for the provided `FormControlName` directive.
|
|
3879
3900
|
*
|
|
@@ -3881,14 +3902,6 @@ declare class FormGroupDirective extends ControlContainer implements Form, OnCha
|
|
|
3881
3902
|
* @param value The new value for the directive's control.
|
|
3882
3903
|
*/
|
|
3883
3904
|
updateModel(dir: FormControlName, value: any): void;
|
|
3884
|
-
/**
|
|
3885
|
-
* @description
|
|
3886
|
-
* Method called with the "submit" event is triggered on the form.
|
|
3887
|
-
* Triggers the `ngSubmit` emitter to emit the "submit" event as its payload.
|
|
3888
|
-
*
|
|
3889
|
-
* @param $event The "submit" event object
|
|
3890
|
-
*/
|
|
3891
|
-
onSubmit($event: Event): boolean;
|
|
3892
3905
|
/**
|
|
3893
3906
|
* @description
|
|
3894
3907
|
* Method called when the "reset" event is triggered on the form.
|
|
@@ -3898,18 +3911,27 @@ declare class FormGroupDirective extends ControlContainer implements Form, OnCha
|
|
|
3898
3911
|
* @description
|
|
3899
3912
|
* Resets the form to an initial value and resets its submitted status.
|
|
3900
3913
|
*
|
|
3901
|
-
* @param value The new value for the form
|
|
3914
|
+
* @param value The new value for the form.
|
|
3902
3915
|
*/
|
|
3903
3916
|
resetForm(value?: any, options?: {
|
|
3904
3917
|
onlySelf?: boolean;
|
|
3905
3918
|
emitEvent?: boolean;
|
|
3906
3919
|
}): void;
|
|
3920
|
+
/**
|
|
3921
|
+
* @description
|
|
3922
|
+
* Method called with the "submit" event is triggered on the form.
|
|
3923
|
+
* Triggers the `ngSubmit` emitter to emit the "submit" event as its payload.
|
|
3924
|
+
*
|
|
3925
|
+
* @param $event The "submit" event object
|
|
3926
|
+
*/
|
|
3927
|
+
onSubmit($event: Event): boolean;
|
|
3907
3928
|
private _setUpFormContainer;
|
|
3908
3929
|
private _cleanUpFormContainer;
|
|
3909
3930
|
private _updateRegistrations;
|
|
3910
3931
|
private _updateValidators;
|
|
3911
|
-
|
|
3912
|
-
static
|
|
3932
|
+
private _checkFormPresent;
|
|
3933
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AbstractFormDirective, [{ optional: true; self: true; }, { optional: true; self: true; }, { optional: true; }]>;
|
|
3934
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<AbstractFormDirective, never, never, {}, {}, never, never, true, never>;
|
|
3913
3935
|
}
|
|
3914
3936
|
|
|
3915
3937
|
/**
|
|
@@ -3979,12 +4001,12 @@ declare class FormGroupName extends AbstractFormGroupDirective implements OnInit
|
|
|
3979
4001
|
*
|
|
3980
4002
|
* Syncs a nested `FormArray` to a DOM element.
|
|
3981
4003
|
*
|
|
3982
|
-
* This directive is designed to be used with a parent `FormGroupDirective` (selector:
|
|
3983
|
-
* `[formGroup]`).
|
|
4004
|
+
* This directive is designed to be used with a parent `FormGroupDirective`/`FormGroupArray` (selector:
|
|
4005
|
+
* `[formGroup]`/`[formArray]`).
|
|
3984
4006
|
*
|
|
3985
4007
|
* It accepts the string name of the nested `FormArray` you want to link, and
|
|
3986
4008
|
* will look for a `FormArray` registered with that name in the parent
|
|
3987
|
-
* `FormGroup` instance you passed into `FormGroupDirective`.
|
|
4009
|
+
* `FormGroup`/`FormArray` instance you passed into `FormGroupDirective`/`FormGroupArray`.
|
|
3988
4010
|
*
|
|
3989
4011
|
* @see [Reactive Forms Guide](guide/forms/reactive-forms)
|
|
3990
4012
|
* @see {@link AbstractControl}
|
|
@@ -4030,7 +4052,7 @@ declare class FormArrayName extends ControlContainer implements OnInit, OnDestro
|
|
|
4030
4052
|
* @description
|
|
4031
4053
|
* The top-level directive for this group if present, otherwise null.
|
|
4032
4054
|
*/
|
|
4033
|
-
get formDirective():
|
|
4055
|
+
get formDirective(): AbstractFormDirective | null;
|
|
4034
4056
|
/**
|
|
4035
4057
|
* @description
|
|
4036
4058
|
* Returns an array that represents the path from the top-level form to this control.
|
|
@@ -4072,7 +4094,7 @@ type SetDisabledStateOption = 'whenDisabledForLegacyCode' | 'always';
|
|
|
4072
4094
|
*
|
|
4073
4095
|
* To inspect the properties of the associated `FormControl` (like the validity state),
|
|
4074
4096
|
* export the directive into a local template variable using `ngModel` as the key (ex:
|
|
4075
|
-
* `#myVar="ngModel"`). You can then access the control using the directive's `
|
|
4097
|
+
* `#myVar="ngModel"`). You can then access the control using the directive's `field` property.
|
|
4076
4098
|
* However, the most commonly used properties (like `valid` and `dirty`) also exist on the control
|
|
4077
4099
|
* for direct access. See a full list of properties directly available in
|
|
4078
4100
|
* `AbstractControlDirective`.
|
|
@@ -4467,7 +4489,49 @@ declare class NgForm extends ControlContainer implements Form, AfterViewInit {
|
|
|
4467
4489
|
private _setUpdateStrategy;
|
|
4468
4490
|
private _findContainer;
|
|
4469
4491
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgForm, [{ optional: true; self: true; }, { optional: true; self: true; }, { optional: true; }]>;
|
|
4470
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<NgForm, "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", ["ngForm"], { "options": { "alias": "ngFormOptions"; "required": false; }; }, { "ngSubmit": "ngSubmit"; }, never, never, false, never>;
|
|
4492
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NgForm, "form:not([ngNoForm]):not([formGroup]):not([formArray]),ng-form,[ngForm]", ["ngForm"], { "options": { "alias": "ngFormOptions"; "required": false; }; }, { "ngSubmit": "ngSubmit"; }, never, never, false, never>;
|
|
4493
|
+
}
|
|
4494
|
+
|
|
4495
|
+
/**
|
|
4496
|
+
* @description
|
|
4497
|
+
*
|
|
4498
|
+
* Binds an existing `FormArray` to a DOM element.
|
|
4499
|
+
*
|
|
4500
|
+
* This directive accepts an existing `FormArray` instance. It will then use this
|
|
4501
|
+
* `FormArray` instance to match any child `FormControl`, `FormGroup`/`FormRecord`,
|
|
4502
|
+
* and `FormArray` instances to child `FormControlName`, `FormGroupName`,
|
|
4503
|
+
* and `FormArrayName` directives.
|
|
4504
|
+
*
|
|
4505
|
+
* @see [Reactive Forms Guide](guide/reactive-forms)
|
|
4506
|
+
* @see {@link AbstractControl}
|
|
4507
|
+
*
|
|
4508
|
+
* @usageNotes
|
|
4509
|
+
* ### Register Form Array
|
|
4510
|
+
*
|
|
4511
|
+
* The following example registers a `FormArray` with first name and last name controls,
|
|
4512
|
+
* and listens for the *ngSubmit* event when the button is clicked.
|
|
4513
|
+
*
|
|
4514
|
+
* @ngModule ReactiveFormsModule
|
|
4515
|
+
* @publicApi
|
|
4516
|
+
*/
|
|
4517
|
+
declare class FormArrayDirective extends AbstractFormDirective {
|
|
4518
|
+
/**
|
|
4519
|
+
* @description
|
|
4520
|
+
* Tracks the `FormArray` bound to this directive.
|
|
4521
|
+
*/
|
|
4522
|
+
form: FormArray;
|
|
4523
|
+
/**
|
|
4524
|
+
* @description
|
|
4525
|
+
* Emits an event when the form submission has been triggered.
|
|
4526
|
+
*/
|
|
4527
|
+
ngSubmit: EventEmitter<any>;
|
|
4528
|
+
/**
|
|
4529
|
+
* @description
|
|
4530
|
+
* Returns the `FormArray` bound to this directive.
|
|
4531
|
+
*/
|
|
4532
|
+
get control(): FormArray;
|
|
4533
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FormArrayDirective, never>;
|
|
4534
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<FormArrayDirective, "[formArray]", ["ngForm"], { "form": { "alias": "formArray"; "required": false; }; }, { "ngSubmit": "ngSubmit"; }, never, never, false, never>;
|
|
4471
4535
|
}
|
|
4472
4536
|
|
|
4473
4537
|
/**
|
|
@@ -4541,6 +4605,50 @@ declare class FormControlDirective extends NgControl implements OnChanges, OnDes
|
|
|
4541
4605
|
static ɵdir: i0.ɵɵDirectiveDeclaration<FormControlDirective, "[formControl]", ["ngForm"], { "form": { "alias": "formControl"; "required": false; }; "isDisabled": { "alias": "disabled"; "required": false; }; "model": { "alias": "ngModel"; "required": false; }; }, { "update": "ngModelChange"; }, never, never, false, never>;
|
|
4542
4606
|
}
|
|
4543
4607
|
|
|
4608
|
+
/**
|
|
4609
|
+
* @description
|
|
4610
|
+
*
|
|
4611
|
+
* Binds an existing `FormGroup` or `FormRecord` to a DOM element.
|
|
4612
|
+
*
|
|
4613
|
+
* This directive accepts an existing `FormGroup` instance. It will then use this
|
|
4614
|
+
* `FormGroup` instance to match any child `FormControl`, `FormGroup`/`FormRecord`,
|
|
4615
|
+
* and `FormArray` instances to child `FormControlName`, `FormGroupName`,
|
|
4616
|
+
* and `FormArrayName` directives.
|
|
4617
|
+
*
|
|
4618
|
+
* @see [Reactive Forms Guide](guide/forms/reactive-forms)
|
|
4619
|
+
* @see {@link AbstractControl}
|
|
4620
|
+
*
|
|
4621
|
+
* @usageNotes
|
|
4622
|
+
* ### Register Form Group
|
|
4623
|
+
*
|
|
4624
|
+
* The following example registers a `FormGroup` with first name and last name controls,
|
|
4625
|
+
* and listens for the *ngSubmit* event when the button is clicked.
|
|
4626
|
+
*
|
|
4627
|
+
* {@example forms/ts/simpleFormGroup/simple_form_group_example.ts region='Component'}
|
|
4628
|
+
*
|
|
4629
|
+
* @ngModule ReactiveFormsModule
|
|
4630
|
+
* @publicApi
|
|
4631
|
+
*/
|
|
4632
|
+
declare class FormGroupDirective extends AbstractFormDirective {
|
|
4633
|
+
/**
|
|
4634
|
+
* @description
|
|
4635
|
+
* Tracks the `FormGroup` bound to this directive.
|
|
4636
|
+
*/
|
|
4637
|
+
form: FormGroup;
|
|
4638
|
+
/**
|
|
4639
|
+
* @description
|
|
4640
|
+
* Emits an event when the form submission has been triggered.
|
|
4641
|
+
*/
|
|
4642
|
+
ngSubmit: EventEmitter<any>;
|
|
4643
|
+
/**
|
|
4644
|
+
* @description
|
|
4645
|
+
* Returns the `FormGroup` bound to this directive.
|
|
4646
|
+
*/
|
|
4647
|
+
get control(): FormGroup;
|
|
4648
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FormGroupDirective, never>;
|
|
4649
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<FormGroupDirective, "[formGroup]", ["ngForm"], { "form": { "alias": "formGroup"; "required": false; }; }, { "ngSubmit": "ngSubmit"; }, never, never, false, never>;
|
|
4650
|
+
}
|
|
4651
|
+
|
|
4544
4652
|
/**
|
|
4545
4653
|
* Internal module used for sharing directives between FormsModule and ReactiveFormsModule
|
|
4546
4654
|
*/
|
|
@@ -5235,9 +5343,9 @@ declare class ReactiveFormsModule {
|
|
|
5235
5343
|
callSetDisabledState?: SetDisabledStateOption;
|
|
5236
5344
|
}): ModuleWithProviders<ReactiveFormsModule>;
|
|
5237
5345
|
static ɵfac: i0.ɵɵFactoryDeclaration<ReactiveFormsModule, never>;
|
|
5238
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<ReactiveFormsModule, [typeof FormControlDirective, typeof FormGroupDirective, typeof FormControlName, typeof FormGroupName, typeof FormArrayName], never, [typeof ɵInternalFormsSharedModule, typeof FormControlDirective, typeof FormGroupDirective, typeof FormControlName, typeof FormGroupName, typeof FormArrayName]>;
|
|
5346
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<ReactiveFormsModule, [typeof FormControlDirective, typeof FormGroupDirective, typeof FormArrayDirective, typeof FormControlName, typeof FormGroupName, typeof FormArrayName], never, [typeof ɵInternalFormsSharedModule, typeof FormControlDirective, typeof FormGroupDirective, typeof FormArrayDirective, typeof FormControlName, typeof FormGroupName, typeof FormArrayName]>;
|
|
5239
5347
|
static ɵinj: i0.ɵɵInjectorDeclaration<ReactiveFormsModule>;
|
|
5240
5348
|
}
|
|
5241
5349
|
|
|
5242
|
-
export { AbstractControl, AbstractControlDirective, AbstractFormGroupDirective, COMPOSITION_BUFFER_MODE, CheckboxControlValueAccessor, CheckboxRequiredValidator, ControlContainer, ControlEvent, DefaultValueAccessor, EmailValidator, FormArray, FormArrayName, FormBuilder, FormControl, FormControlDirective, FormControlName, FormGroup, FormGroupDirective, FormGroupName, FormRecord, FormResetEvent, FormSubmittedEvent, FormsModule, MaxLengthValidator, MaxValidator, MinLengthValidator, MinValidator, NG_ASYNC_VALIDATORS, NG_VALIDATORS, NG_VALUE_ACCESSOR, NgControl, NgControlStatus, NgControlStatusGroup, NgForm, NgModel, NgModelGroup, NgSelectOption, NonNullableFormBuilder, NumberValueAccessor, PatternValidator, PristineChangeEvent, RadioControlValueAccessor, RangeValueAccessor, ReactiveFormsModule, RequiredValidator, SelectControlValueAccessor, SelectMultipleControlValueAccessor, StatusChangeEvent, TouchedChangeEvent, UntypedFormArray, UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, VERSION, Validators, ValueChangeEvent, isFormArray, isFormControl, isFormGroup, isFormRecord, ɵInternalFormsSharedModule, ɵNgNoValidate, ɵNgSelectMultipleOption };
|
|
5350
|
+
export { AbstractControl, AbstractControlDirective, AbstractFormDirective, AbstractFormGroupDirective, COMPOSITION_BUFFER_MODE, CheckboxControlValueAccessor, CheckboxRequiredValidator, ControlContainer, ControlEvent, DefaultValueAccessor, EmailValidator, FormArray, FormArrayDirective, FormArrayName, FormBuilder, FormControl, FormControlDirective, FormControlName, FormGroup, FormGroupDirective, FormGroupName, FormRecord, FormResetEvent, FormSubmittedEvent, FormsModule, MaxLengthValidator, MaxValidator, MinLengthValidator, MinValidator, NG_ASYNC_VALIDATORS, NG_VALIDATORS, NG_VALUE_ACCESSOR, NgControl, NgControlStatus, NgControlStatusGroup, NgForm, NgModel, NgModelGroup, NgSelectOption, NonNullableFormBuilder, NumberValueAccessor, PatternValidator, PristineChangeEvent, RadioControlValueAccessor, RangeValueAccessor, ReactiveFormsModule, RequiredValidator, SelectControlValueAccessor, SelectMultipleControlValueAccessor, StatusChangeEvent, TouchedChangeEvent, UntypedFormArray, UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, VERSION, Validators, ValueChangeEvent, isFormArray, isFormControl, isFormGroup, isFormRecord, ɵInternalFormsSharedModule, ɵNgNoValidate, ɵNgSelectMultipleOption };
|
|
5243
5351
|
export type { AbstractControlOptions, AsyncValidator, AsyncValidatorFn, ControlConfig, ControlValueAccessor, Form, FormControlOptions, FormControlState, FormControlStatus, SetDisabledStateOption, ValidationErrors, Validator, ValidatorFn, ɵCoerceStrArrToNumArr, ɵElement, ɵFormArrayRawValue, ɵFormArrayValue, ɵFormControlCtor, ɵFormGroupRawValue, ɵFormGroupValue, ɵGetProperty, ɵNavigate, ɵOptionalKeys, ɵRawValue, ɵTokenize, ɵTypedOrUntyped, ɵValue, ɵWriteable };
|