@angular/forms 19.0.2 → 19.0.4

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/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v19.0.2
2
+ * @license Angular v19.0.4
3
3
  * (c) 2010-2024 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -995,7 +995,7 @@ declare abstract class AbstractValidatorDirective implements Validator, OnChange
995
995
  * The following example implements the `AsyncValidator` interface to create an
996
996
  * async validator directive with a custom error key.
997
997
  *
998
- * ```typescript
998
+ * ```ts
999
999
  * import { of } from 'rxjs';
1000
1000
  *
1001
1001
  * @Directive({
@@ -1126,7 +1126,7 @@ declare const CHECKBOX_REQUIRED_VALIDATOR: Provider;
1126
1126
  * const rememberLoginControl = new FormControl();
1127
1127
  * ```
1128
1128
  *
1129
- * ```
1129
+ * ```html
1130
1130
  * <input type="checkbox" [formControl]="rememberLoginControl">
1131
1131
  * ```
1132
1132
  *
@@ -1157,7 +1157,7 @@ export declare class CheckboxControlValueAccessor extends BuiltInControlValueAcc
1157
1157
  * The following example shows how to add a checkbox required validator to an input attached to an
1158
1158
  * ngModel binding.
1159
1159
  *
1160
- * ```
1160
+ * ```html
1161
1161
  * <input type="checkbox" name="active" ngModel required>
1162
1162
  * ```
1163
1163
  *
@@ -1368,7 +1368,7 @@ declare const DEFAULT_VALUE_ACCESSOR: Provider;
1368
1368
  * const firstNameControl = new FormControl();
1369
1369
  * ```
1370
1370
  *
1371
- * ```
1371
+ * ```html
1372
1372
  * <input type="text" [formControl]="firstNameControl">
1373
1373
  * ```
1374
1374
  *
@@ -1377,7 +1377,7 @@ declare const DEFAULT_VALUE_ACCESSOR: Provider;
1377
1377
  * processing. In order to attach the default value accessor to a custom element, add the
1378
1378
  * `ngDefaultControl` attribute as shown below.
1379
1379
  *
1380
- * ```
1380
+ * ```html
1381
1381
  * <custom-input-component ngDefaultControl [(ngModel)]="value"></custom-input-component>
1382
1382
  * ```
1383
1383
  *
@@ -1422,7 +1422,7 @@ declare const EMAIL_VALIDATOR: any;
1422
1422
  * The following example shows how to add an email validator to an input attached to an ngModel
1423
1423
  * binding.
1424
1424
  *
1425
- * ```
1425
+ * ```html
1426
1426
  * <input type="email" name="email" ngModel email>
1427
1427
  * <input type="email" name="email" ngModel email="true">
1428
1428
  * <input type="email" name="email" ngModel [email]="true">
@@ -1523,7 +1523,7 @@ export declare interface Form {
1523
1523
  *
1524
1524
  * ### Create an array of form controls
1525
1525
  *
1526
- * ```
1526
+ * ```ts
1527
1527
  * const arr = new FormArray([
1528
1528
  * new FormControl('Nancy', Validators.minLength(2)),
1529
1529
  * new FormControl('Drew'),
@@ -1542,7 +1542,7 @@ export declare interface Form {
1542
1542
  * The two types of validators are passed in separately as the second and third arg
1543
1543
  * respectively, or together as part of an options object.
1544
1544
  *
1545
- * ```
1545
+ * ```ts
1546
1546
  * const arr = new FormArray([
1547
1547
  * new FormControl('Nancy'),
1548
1548
  * new FormControl('Drew')
@@ -2120,7 +2120,7 @@ export declare class FormBuilder {
2120
2120
  * If you are initializing the control to `null`, or you otherwise wish to provide a
2121
2121
  * wider type, you may specify the argument explicitly:
2122
2122
  *
2123
- * ```
2123
+ * ```ts
2124
2124
  * let fc = new FormControl<string|null>(null);
2125
2125
  * fc.setValue('foo');
2126
2126
  * ```
@@ -2166,7 +2166,7 @@ export declare class FormBuilder {
2166
2166
  * If you wish to always reset the control to its initial value (instead of null),
2167
2167
  * you can pass the `nonNullable` option:
2168
2168
  *
2169
- * ```
2169
+ * ```ts
2170
2170
  * const control = new FormControl('Nancy', {nonNullable: true});
2171
2171
  *
2172
2172
  * console.log(control.value); // 'Nancy'
@@ -2178,7 +2178,7 @@ export declare class FormBuilder {
2178
2178
  *
2179
2179
  * ### Reset the control back to an initial value and disabled
2180
2180
  *
2181
- * ```
2181
+ * ```ts
2182
2182
  * const control = new FormControl('Nancy');
2183
2183
  *
2184
2184
  * console.log(control.value); // 'Nancy'
@@ -2531,7 +2531,7 @@ export declare type FormControlStatus = 'VALID' | 'INVALID' | 'PENDING' | 'DISAB
2531
2531
  *
2532
2532
  * ### Create a form group with 2 controls
2533
2533
  *
2534
- * ```
2534
+ * ```ts
2535
2535
  * const form = new FormGroup({
2536
2536
  * first: new FormControl('Nancy', Validators.minLength(2)),
2537
2537
  * last: new FormControl('Drew'),
@@ -2550,7 +2550,7 @@ export declare type FormControlStatus = 'VALID' | 'INVALID' | 'PENDING' | 'DISAB
2550
2550
  * If you have controls that are optional (i.e. they can be removed, you can use the `?` in the
2551
2551
  * type):
2552
2552
  *
2553
- * ```
2553
+ * ```ts
2554
2554
  * const form = new FormGroup<{
2555
2555
  * first: FormControl<string|null>,
2556
2556
  * middle?: FormControl<string|null>, // Middle name is optional.
@@ -2567,7 +2567,7 @@ export declare type FormControlStatus = 'VALID' | 'INVALID' | 'PENDING' | 'DISAB
2567
2567
  * validators as the third arg. These come in handy when you want to perform validation
2568
2568
  * that considers the value of more than one child control.
2569
2569
  *
2570
- * ```
2570
+ * ```ts
2571
2571
  * const form = new FormGroup({
2572
2572
  * password: new FormControl('', Validators.minLength(2)),
2573
2573
  * passwordConfirm: new FormControl('', Validators.minLength(2)),
@@ -2583,7 +2583,7 @@ export declare type FormControlStatus = 'VALID' | 'INVALID' | 'PENDING' | 'DISAB
2583
2583
  * Like `FormControl` instances, you choose to pass in
2584
2584
  * validators and async validators as part of an options object.
2585
2585
  *
2586
- * ```
2586
+ * ```ts
2587
2587
  * const form = new FormGroup({
2588
2588
  * password: new FormControl('')
2589
2589
  * passwordConfirm: new FormControl('')
@@ -3118,7 +3118,7 @@ declare type FormHooks = 'change' | 'blur' | 'submit';
3118
3118
  *
3119
3119
  * @usageNotes
3120
3120
  *
3121
- * ```
3121
+ * ```ts
3122
3122
  * let numbers = new FormRecord({bill: new FormControl('415-123-456')});
3123
3123
  * numbers.addControl('bob', new FormControl('415-234-567'));
3124
3124
  * numbers.removeControl('bill');
@@ -3627,7 +3627,7 @@ declare const modelGroupProvider: any;
3627
3627
  * The following example implements the `AsyncValidator` interface to create an
3628
3628
  * async validator directive with a custom error key.
3629
3629
  *
3630
- * ```typescript
3630
+ * ```ts
3631
3631
  * @Directive({
3632
3632
  * selector: '[customAsyncValidator]',
3633
3633
  * providers: [{provide: NG_ASYNC_VALIDATORS, useExisting: CustomAsyncValidatorDirective, multi:
@@ -3663,7 +3663,7 @@ declare const NG_MODEL_WITH_FORM_CONTROL_WARNING: InjectionToken<unknown>;
3663
3663
  * The following example registers a custom validator directive. Adding the validator to the
3664
3664
  * existing collection of validators requires the `multi: true` option.
3665
3665
  *
3666
- * ```typescript
3666
+ * ```ts
3667
3667
  * @Directive({
3668
3668
  * selector: '[customValidator]',
3669
3669
  * providers: [{provide: NG_VALIDATORS, useExisting: CustomValidatorDirective, multi: true}]
@@ -4294,7 +4294,7 @@ export declare abstract class NonNullableFormBuilder {
4294
4294
  * const totalCountControl = new FormControl();
4295
4295
  * ```
4296
4296
  *
4297
- * ```
4297
+ * ```html
4298
4298
  * <input type="number" [formControl]="totalCountControl">
4299
4299
  * ```
4300
4300
  *
@@ -4503,7 +4503,7 @@ export declare class RadioControlValueAccessor extends BuiltInControlValueAccess
4503
4503
  * const ageControl = new FormControl();
4504
4504
  * ```
4505
4505
  *
4506
- * ```
4506
+ * ```html
4507
4507
  * <input type="range" [formControl]="ageControl">
4508
4508
  * ```
4509
4509
  *
@@ -4574,7 +4574,7 @@ declare const REQUIRED_VALIDATOR: Provider;
4574
4574
  *
4575
4575
  * ### Adding a required validator using template-driven forms
4576
4576
  *
4577
- * ```
4577
+ * ```html
4578
4578
  * <input name="fullName" ngModel required>
4579
4579
  * ```
4580
4580
  *
@@ -4630,7 +4630,7 @@ export declare class RequiredValidator extends AbstractValidatorDirective {
4630
4630
  * const selectedCountriesControl = new FormControl();
4631
4631
  * ```
4632
4632
  *
4633
- * ```
4633
+ * ```html
4634
4634
  * <select [compareWith]="compareFn" [formControl]="selectedCountriesControl">
4635
4635
  * <option *ngFor="let country of countries" [ngValue]="country">
4636
4636
  * {{country.name}}
@@ -4692,7 +4692,7 @@ export declare class SelectControlValueAccessor extends BuiltInControlValueAcces
4692
4692
  * const countryControl = new FormControl();
4693
4693
  * ```
4694
4694
  *
4695
- * ```
4695
+ * ```html
4696
4696
  * <select multiple name="countries" [formControl]="countryControl">
4697
4697
  * <option *ngFor="let country of countries" [ngValue]="country">
4698
4698
  * {{ country.name }}
@@ -4877,7 +4877,7 @@ export declare type ValidationErrors = {
4877
4877
  * The following example implements the `Validator` interface to create a
4878
4878
  * validator directive with a custom error key.
4879
4879
  *
4880
- * ```typescript
4880
+ * ```ts
4881
4881
  * @Directive({
4882
4882
  * selector: '[customValidator]',
4883
4883
  * providers: [{provide: NG_VALIDATORS, useExisting: CustomValidatorDirective, multi: true}]
@@ -4947,7 +4947,7 @@ export declare class Validators {
4947
4947
  *
4948
4948
  * ### Validate against a minimum of 3
4949
4949
  *
4950
- * ```typescript
4950
+ * ```ts
4951
4951
  * const control = new FormControl(2, Validators.min(3));
4952
4952
  *
4953
4953
  * console.log(control.errors); // {min: {min: 3, actual: 2}}
@@ -4968,7 +4968,7 @@ export declare class Validators {
4968
4968
  *
4969
4969
  * ### Validate against a maximum of 15
4970
4970
  *
4971
- * ```typescript
4971
+ * ```ts
4972
4972
  * const control = new FormControl(16, Validators.max(15));
4973
4973
  *
4974
4974
  * console.log(control.errors); // {max: {max: 15, actual: 16}}
@@ -4989,7 +4989,7 @@ export declare class Validators {
4989
4989
  *
4990
4990
  * ### Validate that the field is non-empty
4991
4991
  *
4992
- * ```typescript
4992
+ * ```ts
4993
4993
  * const control = new FormControl('', Validators.required);
4994
4994
  *
4995
4995
  * console.log(control.errors); // {required: true}
@@ -5011,7 +5011,7 @@ export declare class Validators {
5011
5011
  *
5012
5012
  * ### Validate that the field value is true
5013
5013
  *
5014
- * ```typescript
5014
+ * ```ts
5015
5015
  * const control = new FormControl('some value', Validators.requiredTrue);
5016
5016
  *
5017
5017
  * console.log(control.errors); // {required: true}
@@ -5048,7 +5048,7 @@ export declare class Validators {
5048
5048
  *
5049
5049
  * ### Validate that the field matches a valid email pattern
5050
5050
  *
5051
- * ```typescript
5051
+ * ```ts
5052
5052
  * const control = new FormControl('bad@', Validators.email);
5053
5053
  *
5054
5054
  * console.log(control.errors); // {email: true}
@@ -5075,7 +5075,7 @@ export declare class Validators {
5075
5075
  *
5076
5076
  * ### Validate that the field has a minimum of 3 characters
5077
5077
  *
5078
- * ```typescript
5078
+ * ```ts
5079
5079
  * const control = new FormControl('ng', Validators.minLength(3));
5080
5080
  *
5081
5081
  * console.log(control.errors); // {minlength: {requiredLength: 3, actualLength: 2}}
@@ -5103,7 +5103,7 @@ export declare class Validators {
5103
5103
  *
5104
5104
  * ### Validate that the field has maximum of 5 characters
5105
5105
  *
5106
- * ```typescript
5106
+ * ```ts
5107
5107
  * const control = new FormControl('Angular', Validators.maxLength(5));
5108
5108
  *
5109
5109
  * console.log(control.errors); // {maxlength: {requiredLength: 5, actualLength: 7}}
@@ -5129,7 +5129,7 @@ export declare class Validators {
5129
5129
  *
5130
5130
  * ### Validate that the field only contains letters or spaces
5131
5131
  *
5132
- * ```typescript
5132
+ * ```ts
5133
5133
  * const control = new FormControl('1', Validators.pattern('[a-zA-Z ]*'));
5134
5134
  *
5135
5135
  * console.log(control.errors); // {pattern: {requiredPattern: '^[a-zA-Z ]*$', actualValue: '1'}}
@@ -5150,7 +5150,7 @@ export declare class Validators {
5150
5150
  * `Validators.pattern` you **do not** pass in a `RegExp` object with either the global or sticky
5151
5151
  * flag enabled.
5152
5152
  *
5153
- * ```typescript
5153
+ * ```ts
5154
5154
  * // Not recommended (since the `g` flag is used)
5155
5155
  * const controlOne = new FormControl('1', Validators.pattern(/foo/g));
5156
5156
  *
@@ -5277,7 +5277,7 @@ export declare type ɵFormArrayValue<T extends AbstractControl<any>> = ɵTypedOr
5277
5277
  /**
5278
5278
  * Various available constructors for `FormControl`.
5279
5279
  * Do not use this interface directly. Instead, use `FormControl`:
5280
- * ```
5280
+ * ```ts
5281
5281
  * const fc = new FormControl('foo');
5282
5282
  * ```
5283
5283
  * This symbol is prefixed with ɵ to make plain that it is an internal symbol.
@@ -5388,7 +5388,7 @@ export declare type ɵNavigate<T, K extends Array<string | number>> = T extends
5388
5388
  *
5389
5389
  * If you want to use native validation with Angular forms, just add `ngNativeValidate` attribute:
5390
5390
  *
5391
- * ```
5391
+ * ```html
5392
5392
  * <form ngNativeValidate></form>
5393
5393
  * ```
5394
5394
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/forms",
3
- "version": "19.0.2",
3
+ "version": "19.0.4",
4
4
  "description": "Angular - directives and services for creating forms",
5
5
  "author": "angular",
6
6
  "license": "MIT",
@@ -11,9 +11,9 @@
11
11
  "tslib": "^2.3.0"
12
12
  },
13
13
  "peerDependencies": {
14
- "@angular/core": "19.0.2",
15
- "@angular/common": "19.0.2",
16
- "@angular/platform-browser": "19.0.2",
14
+ "@angular/core": "19.0.4",
15
+ "@angular/common": "19.0.4",
16
+ "@angular/platform-browser": "19.0.4",
17
17
  "rxjs": "^6.5.3 || ^7.4.0"
18
18
  },
19
19
  "repository": {