2021-06-28 19:54:20 +02:00
|
|
|
## API Report File for "@angular/forms"
|
|
|
|
|
|
|
|
|
|
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
|
|
|
|
|
|
|
|
```ts
|
|
|
|
|
|
|
|
|
|
import { AfterViewInit } from '@angular/core';
|
2022-01-29 06:44:34 +02:00
|
|
|
import { ChangeDetectorRef } from '@angular/core';
|
2021-06-28 19:54:20 +02:00
|
|
|
import { ElementRef } from '@angular/core';
|
|
|
|
|
import { EventEmitter } from '@angular/core';
|
2021-09-19 20:38:34 +02:00
|
|
|
import * as i0 from '@angular/core';
|
2021-06-28 19:54:20 +02:00
|
|
|
import { InjectionToken } from '@angular/core';
|
|
|
|
|
import { Injector } from '@angular/core';
|
|
|
|
|
import { ModuleWithProviders } from '@angular/core';
|
|
|
|
|
import { Observable } from 'rxjs';
|
|
|
|
|
import { OnChanges } from '@angular/core';
|
|
|
|
|
import { OnDestroy } from '@angular/core';
|
|
|
|
|
import { OnInit } from '@angular/core';
|
|
|
|
|
import { Renderer2 } from '@angular/core';
|
|
|
|
|
import { SimpleChanges } from '@angular/core';
|
|
|
|
|
import { Version } from '@angular/core';
|
|
|
|
|
|
|
|
|
|
// @public
|
|
|
|
|
export abstract class AbstractControl {
|
|
|
|
|
constructor(validators: ValidatorFn | ValidatorFn[] | null, asyncValidators: AsyncValidatorFn | AsyncValidatorFn[] | null);
|
2021-07-12 10:41:02 -07:00
|
|
|
addAsyncValidators(validators: AsyncValidatorFn | AsyncValidatorFn[]): void;
|
|
|
|
|
addValidators(validators: ValidatorFn | ValidatorFn[]): void;
|
2020-07-01 18:16:49 -07:00
|
|
|
get asyncValidator(): AsyncValidatorFn | null;
|
|
|
|
|
set asyncValidator(asyncValidatorFn: AsyncValidatorFn | null);
|
2016-06-22 14:56:10 -07:00
|
|
|
clearAsyncValidators(): void;
|
|
|
|
|
clearValidators(): void;
|
2021-06-28 19:54:20 +02:00
|
|
|
get dirty(): boolean;
|
2017-06-12 10:59:29 -07:00
|
|
|
disable(opts?: {
|
2016-08-24 16:58:43 -07:00
|
|
|
onlySelf?: boolean;
|
|
|
|
|
emitEvent?: boolean;
|
|
|
|
|
}): void;
|
2021-06-28 19:54:20 +02:00
|
|
|
get disabled(): boolean;
|
2017-06-12 10:59:29 -07:00
|
|
|
enable(opts?: {
|
2016-08-24 16:58:43 -07:00
|
|
|
onlySelf?: boolean;
|
|
|
|
|
emitEvent?: boolean;
|
|
|
|
|
}): void;
|
2021-06-28 19:54:20 +02:00
|
|
|
get enabled(): boolean;
|
|
|
|
|
readonly errors: ValidationErrors | null;
|
2017-04-17 11:13:30 -07:00
|
|
|
get(path: Array<string | number> | string): AbstractControl | null;
|
2018-12-22 13:39:37 +13:00
|
|
|
getError(errorCode: string, path?: Array<string | number> | string): any;
|
2022-02-24 22:52:25 -08:00
|
|
|
getRawValue(): any;
|
2021-07-12 10:41:02 -07:00
|
|
|
hasAsyncValidator(validator: AsyncValidatorFn): boolean;
|
2018-12-22 13:39:37 +13:00
|
|
|
hasError(errorCode: string, path?: Array<string | number> | string): boolean;
|
2021-07-12 10:41:02 -07:00
|
|
|
hasValidator(validator: ValidatorFn): boolean;
|
2021-06-28 19:54:20 +02:00
|
|
|
get invalid(): boolean;
|
2018-10-29 09:36:17 +01:00
|
|
|
markAllAsTouched(): void;
|
2017-06-12 10:59:29 -07:00
|
|
|
markAsDirty(opts?: {
|
2016-06-22 14:56:10 -07:00
|
|
|
onlySelf?: boolean;
|
|
|
|
|
}): void;
|
2017-06-12 10:59:29 -07:00
|
|
|
markAsPending(opts?: {
|
2016-06-22 14:56:10 -07:00
|
|
|
onlySelf?: boolean;
|
2017-11-06 21:59:09 +13:00
|
|
|
emitEvent?: boolean;
|
2016-06-22 14:56:10 -07:00
|
|
|
}): void;
|
2017-06-12 10:59:29 -07:00
|
|
|
markAsPristine(opts?: {
|
2016-07-12 15:02:25 -07:00
|
|
|
onlySelf?: boolean;
|
|
|
|
|
}): void;
|
2017-06-12 10:59:29 -07:00
|
|
|
markAsTouched(opts?: {
|
2016-07-01 15:36:04 -07:00
|
|
|
onlySelf?: boolean;
|
|
|
|
|
}): void;
|
2017-06-12 10:59:29 -07:00
|
|
|
markAsUntouched(opts?: {
|
2016-07-12 15:02:25 -07:00
|
|
|
onlySelf?: boolean;
|
|
|
|
|
}): void;
|
2021-06-28 19:54:20 +02:00
|
|
|
get parent(): FormGroup | FormArray | null;
|
2016-08-05 13:35:17 -07:00
|
|
|
abstract patchValue(value: any, options?: Object): void;
|
2021-06-28 19:54:20 +02:00
|
|
|
get pending(): boolean;
|
|
|
|
|
readonly pristine: boolean;
|
2021-07-12 10:41:02 -07:00
|
|
|
removeAsyncValidators(validators: AsyncValidatorFn | AsyncValidatorFn[]): void;
|
|
|
|
|
removeValidators(validators: ValidatorFn | ValidatorFn[]): void;
|
2016-07-12 15:02:25 -07:00
|
|
|
abstract reset(value?: any, options?: Object): void;
|
2021-06-28 19:54:20 +02:00
|
|
|
get root(): AbstractControl;
|
2021-07-12 10:41:02 -07:00
|
|
|
setAsyncValidators(validators: AsyncValidatorFn | AsyncValidatorFn[] | null): void;
|
2017-06-12 10:59:29 -07:00
|
|
|
setErrors(errors: ValidationErrors | null, opts?: {
|
2016-06-22 14:56:10 -07:00
|
|
|
emitEvent?: boolean;
|
|
|
|
|
}): void;
|
2021-06-28 19:54:20 +02:00
|
|
|
// (undocumented)
|
2016-06-23 18:19:32 -07:00
|
|
|
setParent(parent: FormGroup | FormArray): void;
|
2021-07-12 10:41:02 -07:00
|
|
|
setValidators(validators: ValidatorFn | ValidatorFn[] | null): void;
|
2016-08-05 13:35:17 -07:00
|
|
|
abstract setValue(value: any, options?: Object): void;
|
2021-07-23 14:35:08 -07:00
|
|
|
readonly status: FormControlStatus;
|
|
|
|
|
readonly statusChanges: Observable<FormControlStatus>;
|
2021-06-28 19:54:20 +02:00
|
|
|
readonly touched: boolean;
|
|
|
|
|
get untouched(): boolean;
|
|
|
|
|
get updateOn(): FormHooks;
|
2017-06-12 10:59:29 -07:00
|
|
|
updateValueAndValidity(opts?: {
|
2016-06-23 18:19:32 -07:00
|
|
|
onlySelf?: boolean;
|
|
|
|
|
emitEvent?: boolean;
|
|
|
|
|
}): void;
|
2021-06-28 19:54:20 +02:00
|
|
|
get valid(): boolean;
|
|
|
|
|
get validator(): ValidatorFn | null;
|
|
|
|
|
set validator(validatorFn: ValidatorFn | null);
|
|
|
|
|
readonly value: any;
|
|
|
|
|
readonly valueChanges: Observable<any>;
|
2016-06-22 14:56:10 -07:00
|
|
|
}
|
|
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public
|
|
|
|
|
export abstract class AbstractControlDirective {
|
2020-07-27 19:31:40 -07:00
|
|
|
get asyncValidator(): AsyncValidatorFn | null;
|
2019-11-09 20:36:22 +02:00
|
|
|
abstract get control(): AbstractControl | null;
|
|
|
|
|
get dirty(): boolean | null;
|
|
|
|
|
get disabled(): boolean | null;
|
|
|
|
|
get enabled(): boolean | null;
|
|
|
|
|
get errors(): ValidationErrors | null;
|
2021-06-28 19:54:20 +02:00
|
|
|
getError(errorCode: string, path?: Array<string | number> | string): any;
|
|
|
|
|
hasError(errorCode: string, path?: Array<string | number> | string): boolean;
|
2019-11-09 20:36:22 +02:00
|
|
|
get invalid(): boolean | null;
|
|
|
|
|
get path(): string[] | null;
|
|
|
|
|
get pending(): boolean | null;
|
|
|
|
|
get pristine(): boolean | null;
|
2021-06-28 19:54:20 +02:00
|
|
|
reset(value?: any): void;
|
2019-11-09 20:36:22 +02:00
|
|
|
get status(): string | null;
|
|
|
|
|
get statusChanges(): Observable<any> | null;
|
|
|
|
|
get touched(): boolean | null;
|
|
|
|
|
get untouched(): boolean | null;
|
|
|
|
|
get valid(): boolean | null;
|
2020-07-27 19:31:40 -07:00
|
|
|
get validator(): ValidatorFn | null;
|
2019-11-09 20:36:22 +02:00
|
|
|
get value(): any;
|
|
|
|
|
get valueChanges(): Observable<any> | null;
|
2016-06-22 14:56:10 -07:00
|
|
|
}
|
|
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public
|
|
|
|
|
export interface AbstractControlOptions {
|
2018-02-01 11:25:14 +08:00
|
|
|
asyncValidators?: AsyncValidatorFn | AsyncValidatorFn[] | null;
|
|
|
|
|
updateOn?: 'change' | 'blur' | 'submit';
|
|
|
|
|
validators?: ValidatorFn | ValidatorFn[] | null;
|
|
|
|
|
}
|
|
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public
|
|
|
|
|
export class AbstractFormGroupDirective extends ControlContainer implements OnInit, OnDestroy {
|
2019-11-09 20:36:22 +02:00
|
|
|
get control(): FormGroup;
|
|
|
|
|
get formDirective(): Form | null;
|
2021-06-28 19:54:20 +02:00
|
|
|
// (undocumented)
|
2016-07-07 20:14:42 -07:00
|
|
|
ngOnDestroy(): void;
|
2021-06-28 19:54:20 +02:00
|
|
|
// (undocumented)
|
2016-07-07 20:14:42 -07:00
|
|
|
ngOnInit(): void;
|
2021-06-28 19:54:20 +02:00
|
|
|
get path(): string[];
|
2021-09-19 20:38:34 +02:00
|
|
|
// (undocumented)
|
|
|
|
|
static ɵdir: i0.ɵɵDirectiveDeclaration<AbstractFormGroupDirective, never, never, {}, {}, never>;
|
|
|
|
|
// (undocumented)
|
|
|
|
|
static ɵfac: i0.ɵɵFactoryDeclaration<AbstractFormGroupDirective, never>;
|
2016-07-07 20:14:42 -07:00
|
|
|
}
|
|
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public
|
|
|
|
|
export interface AsyncValidator extends Validator {
|
2018-09-20 15:18:14 +01:00
|
|
|
validate(control: AbstractControl): Promise<ValidationErrors | null> | Observable<ValidationErrors | null>;
|
2017-02-21 03:26:51 +03:00
|
|
|
}
|
|
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public
|
|
|
|
|
export interface AsyncValidatorFn {
|
|
|
|
|
// (undocumented)
|
2018-09-20 15:18:14 +01:00
|
|
|
(control: AbstractControl): Promise<ValidationErrors | null> | Observable<ValidationErrors | null>;
|
2016-06-24 18:24:11 -07:00
|
|
|
}
|
|
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public
|
2021-09-19 20:38:34 +02:00
|
|
|
export class CheckboxControlValueAccessor extends BuiltInControlValueAccessor implements ControlValueAccessor {
|
2016-06-23 18:19:32 -07:00
|
|
|
writeValue(value: any): void;
|
2021-09-19 20:38:34 +02:00
|
|
|
// (undocumented)
|
|
|
|
|
static ɵdir: i0.ɵɵDirectiveDeclaration<CheckboxControlValueAccessor, "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]", never, {}, {}, never>;
|
|
|
|
|
// (undocumented)
|
|
|
|
|
static ɵfac: i0.ɵɵFactoryDeclaration<CheckboxControlValueAccessor, never>;
|
2016-06-22 14:56:10 -07:00
|
|
|
}
|
|
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public
|
|
|
|
|
export class CheckboxRequiredValidator extends RequiredValidator {
|
2021-09-19 20:38:34 +02:00
|
|
|
// (undocumented)
|
|
|
|
|
static ɵdir: i0.ɵɵDirectiveDeclaration<CheckboxRequiredValidator, "input[type=checkbox][required][formControlName],input[type=checkbox][required][formControl],input[type=checkbox][required][ngModel]", never, {}, {}, never>;
|
|
|
|
|
// (undocumented)
|
|
|
|
|
static ɵfac: i0.ɵɵFactoryDeclaration<CheckboxRequiredValidator, never>;
|
2016-12-10 13:44:04 +03:00
|
|
|
}
|
|
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public
|
|
|
|
|
export const COMPOSITION_BUFFER_MODE: InjectionToken<boolean>;
|
fix(forms): make composition event buffering configurable (#15256)
This commit fixes a regression where `ngModel` no longer syncs
letter by letter on Android devices, and instead syncs at the
end of every word. This broke when we introduced buffering of
IME events so IMEs like Pinyin keyboards or Katakana keyboards
wouldn't display composition strings. Unfortunately, iOS devices
and Android devices have opposite event behavior. Whereas iOS
devices fire composition events for IME keyboards only, Android
fires composition events for Latin-language keyboards. For
this reason, languages like English don't work as expected on
Android if we always buffer. So to support both platforms,
composition string buffering will only be turned on by default
for non-Android devices.
However, we have also added a `COMPOSITION_BUFFER_MODE` token
to make this configurable by the application. In some cases, apps
might might still want to receive intermediate values. For example,
some inputs begin searching based on Latin letters before a
character selection is made.
As a provider, this is fairly flexible. If you want to turn
composition buffering off, simply provide the token at the top
level:
```ts
providers: [
{provide: COMPOSITION_BUFFER_MODE, useValue: false}
]
```
Or, if you want to change the mode based on locale or platform,
you can use a factory:
```ts
import {shouldUseBuffering} from 'my/lib';
....
providers: [
{provide: COMPOSITION_BUFFER_MODE, useFactory: shouldUseBuffering}
]
```
Closes #15079.
PR Close #15256
2017-03-20 17:38:33 -07:00
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public
|
|
|
|
|
export abstract class ControlContainer extends AbstractControlDirective {
|
2019-11-09 20:36:22 +02:00
|
|
|
get formDirective(): Form | null;
|
2019-09-10 22:39:47 +02:00
|
|
|
name: string | number | null;
|
2019-11-09 20:36:22 +02:00
|
|
|
get path(): string[] | null;
|
2016-06-22 14:56:10 -07:00
|
|
|
}
|
|
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public
|
|
|
|
|
export interface ControlValueAccessor {
|
2016-06-22 14:56:10 -07:00
|
|
|
registerOnChange(fn: any): void;
|
|
|
|
|
registerOnTouched(fn: any): void;
|
2016-08-24 16:58:43 -07:00
|
|
|
setDisabledState?(isDisabled: boolean): void;
|
2016-06-23 18:19:32 -07:00
|
|
|
writeValue(obj: any): void;
|
2016-06-22 14:56:10 -07:00
|
|
|
}
|
|
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public
|
2021-09-19 20:38:34 +02:00
|
|
|
export class DefaultValueAccessor extends BaseControlValueAccessor implements ControlValueAccessor {
|
2021-03-15 18:56:06 -07:00
|
|
|
constructor(renderer: Renderer2, elementRef: ElementRef, _compositionMode: boolean);
|
2016-06-23 18:19:32 -07:00
|
|
|
writeValue(value: any): void;
|
2021-09-19 20:38:34 +02:00
|
|
|
// (undocumented)
|
|
|
|
|
static ɵdir: i0.ɵɵDirectiveDeclaration<DefaultValueAccessor, "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]", never, {}, {}, never>;
|
|
|
|
|
// (undocumented)
|
|
|
|
|
static ɵfac: i0.ɵɵFactoryDeclaration<DefaultValueAccessor, [null, null, { optional: true; }]>;
|
2016-06-22 14:56:10 -07:00
|
|
|
}
|
|
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public
|
2021-12-21 15:08:09 +05:30
|
|
|
export class EmailValidator extends AbstractValidatorDirective {
|
|
|
|
|
email: boolean | string;
|
|
|
|
|
// (undocumented)
|
|
|
|
|
enabled(input: boolean): boolean;
|
2021-09-19 20:38:34 +02:00
|
|
|
// (undocumented)
|
|
|
|
|
static ɵdir: i0.ɵɵDirectiveDeclaration<EmailValidator, "[email][formControlName],[email][formControl],[email][ngModel]", never, { "email": "email"; }, {}, never>;
|
|
|
|
|
// (undocumented)
|
|
|
|
|
static ɵfac: i0.ɵɵFactoryDeclaration<EmailValidator, never>;
|
2016-12-29 20:07:02 +03:00
|
|
|
}
|
|
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public
|
|
|
|
|
export interface Form {
|
2016-06-22 14:56:10 -07:00
|
|
|
addControl(dir: NgControl): void;
|
|
|
|
|
addFormGroup(dir: AbstractFormGroupDirective): void;
|
2016-06-23 18:19:32 -07:00
|
|
|
getControl(dir: NgControl): FormControl;
|
2016-06-22 14:56:10 -07:00
|
|
|
getFormGroup(dir: AbstractFormGroupDirective): FormGroup;
|
2016-06-23 18:19:32 -07:00
|
|
|
removeControl(dir: NgControl): void;
|
|
|
|
|
removeFormGroup(dir: AbstractFormGroupDirective): void;
|
2016-06-22 14:56:10 -07:00
|
|
|
updateModel(dir: NgControl, value: any): void;
|
|
|
|
|
}
|
|
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public
|
|
|
|
|
export class FormArray extends AbstractControl {
|
2017-07-25 15:01:04 -07:00
|
|
|
constructor(controls: AbstractControl[], validatorOrOpts?: ValidatorFn | ValidatorFn[] | AbstractControlOptions | null, asyncValidator?: AsyncValidatorFn | AsyncValidatorFn[] | null);
|
2016-06-22 14:56:10 -07:00
|
|
|
at(index: number): AbstractControl;
|
2021-02-11 12:01:32 +00:00
|
|
|
clear(options?: {
|
|
|
|
|
emitEvent?: boolean;
|
|
|
|
|
}): void;
|
2021-06-28 19:54:20 +02:00
|
|
|
// (undocumented)
|
|
|
|
|
controls: AbstractControl[];
|
2016-08-24 16:58:43 -07:00
|
|
|
getRawValue(): any[];
|
2021-02-11 12:01:32 +00:00
|
|
|
insert(index: number, control: AbstractControl, options?: {
|
|
|
|
|
emitEvent?: boolean;
|
|
|
|
|
}): void;
|
2021-06-28 19:54:20 +02:00
|
|
|
get length(): number;
|
2017-04-27 13:39:21 -07:00
|
|
|
patchValue(value: any[], options?: {
|
2016-08-05 13:35:17 -07:00
|
|
|
onlySelf?: boolean;
|
2016-10-19 18:54:54 +02:00
|
|
|
emitEvent?: boolean;
|
2016-08-05 13:35:17 -07:00
|
|
|
}): void;
|
2021-02-11 12:01:32 +00:00
|
|
|
push(control: AbstractControl, options?: {
|
|
|
|
|
emitEvent?: boolean;
|
|
|
|
|
}): void;
|
|
|
|
|
removeAt(index: number, options?: {
|
|
|
|
|
emitEvent?: boolean;
|
|
|
|
|
}): void;
|
2017-04-27 13:39:21 -07:00
|
|
|
reset(value?: any, options?: {
|
2016-07-12 15:02:25 -07:00
|
|
|
onlySelf?: boolean;
|
2016-10-19 18:54:54 +02:00
|
|
|
emitEvent?: boolean;
|
2016-07-12 15:02:25 -07:00
|
|
|
}): void;
|
2021-02-11 12:01:32 +00:00
|
|
|
setControl(index: number, control: AbstractControl, options?: {
|
|
|
|
|
emitEvent?: boolean;
|
|
|
|
|
}): void;
|
2017-04-27 13:39:21 -07:00
|
|
|
setValue(value: any[], options?: {
|
2016-07-08 13:04:25 -07:00
|
|
|
onlySelf?: boolean;
|
2016-10-19 18:54:54 +02:00
|
|
|
emitEvent?: boolean;
|
2016-07-08 13:04:25 -07:00
|
|
|
}): void;
|
2016-06-22 14:56:10 -07:00
|
|
|
}
|
|
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public
|
|
|
|
|
export class FormArrayName extends ControlContainer implements OnInit, OnDestroy {
|
|
|
|
|
constructor(parent: ControlContainer, validators: (Validator | ValidatorFn)[], asyncValidators: (AsyncValidator | AsyncValidatorFn)[]);
|
2019-11-09 20:36:22 +02:00
|
|
|
get control(): FormArray;
|
|
|
|
|
get formDirective(): FormGroupDirective | null;
|
2019-09-10 22:39:47 +02:00
|
|
|
name: string | number | null;
|
2016-06-25 13:27:29 -07:00
|
|
|
ngOnDestroy(): void;
|
|
|
|
|
ngOnInit(): void;
|
2021-06-28 19:54:20 +02:00
|
|
|
get path(): string[];
|
2021-09-19 20:38:34 +02:00
|
|
|
// (undocumented)
|
|
|
|
|
static ɵdir: i0.ɵɵDirectiveDeclaration<FormArrayName, "[formArrayName]", never, { "name": "formArrayName"; }, {}, never>;
|
|
|
|
|
// (undocumented)
|
|
|
|
|
static ɵfac: i0.ɵɵFactoryDeclaration<FormArrayName, [{ optional: true; host: true; skipSelf: true; }, { optional: true; self: true; }, { optional: true; self: true; }]>;
|
2016-06-25 13:27:29 -07:00
|
|
|
}
|
|
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public
|
|
|
|
|
export class FormBuilder {
|
2018-06-20 19:21:46 +02:00
|
|
|
array(controlsConfig: any[], validatorOrOpts?: ValidatorFn | ValidatorFn[] | AbstractControlOptions | null, asyncValidator?: AsyncValidatorFn | AsyncValidatorFn[] | null): FormArray;
|
2021-12-10 13:56:17 -08:00
|
|
|
control(formState: any, validatorOrOpts?: ValidatorFn | ValidatorFn[] | FormControlOptions | null, asyncValidator?: AsyncValidatorFn | AsyncValidatorFn[] | null): FormControl;
|
2016-06-22 14:56:10 -07:00
|
|
|
group(controlsConfig: {
|
|
|
|
|
[key: string]: any;
|
2020-11-19 12:29:20 -08:00
|
|
|
}, options?: AbstractControlOptions | null): FormGroup;
|
2021-06-28 19:54:20 +02:00
|
|
|
// @deprecated
|
|
|
|
|
group(controlsConfig: {
|
2016-06-22 14:56:10 -07:00
|
|
|
[key: string]: any;
|
2020-11-19 12:29:20 -08:00
|
|
|
}, options: {
|
|
|
|
|
[key: string]: any;
|
|
|
|
|
}): FormGroup;
|
2021-09-19 20:38:34 +02:00
|
|
|
// (undocumented)
|
|
|
|
|
static ɵfac: i0.ɵɵFactoryDeclaration<FormBuilder, never>;
|
|
|
|
|
// (undocumented)
|
|
|
|
|
static ɵprov: i0.ɵɵInjectableDeclaration<FormBuilder>;
|
2016-06-22 14:56:10 -07:00
|
|
|
}
|
|
|
|
|
|
2022-01-18 19:51:56 -08:00
|
|
|
// @public
|
2021-11-30 14:46:46 -05:00
|
|
|
export interface FormControl extends AbstractControl {
|
2021-12-10 13:56:17 -08:00
|
|
|
readonly defaultValue: any;
|
2016-08-05 13:35:17 -07:00
|
|
|
patchValue(value: any, options?: {
|
|
|
|
|
onlySelf?: boolean;
|
|
|
|
|
emitEvent?: boolean;
|
|
|
|
|
emitModelToViewChange?: boolean;
|
|
|
|
|
emitViewToModelChange?: boolean;
|
|
|
|
|
}): void;
|
2016-06-23 18:19:32 -07:00
|
|
|
registerOnChange(fn: Function): void;
|
2016-08-24 16:58:43 -07:00
|
|
|
registerOnDisabledChange(fn: (isDisabled: boolean) => void): void;
|
2017-04-27 13:39:21 -07:00
|
|
|
reset(formState?: any, options?: {
|
2016-07-12 15:02:25 -07:00
|
|
|
onlySelf?: boolean;
|
2016-10-19 18:54:54 +02:00
|
|
|
emitEvent?: boolean;
|
2016-07-12 15:02:25 -07:00
|
|
|
}): void;
|
2017-04-27 13:39:21 -07:00
|
|
|
setValue(value: any, options?: {
|
2016-08-05 13:35:17 -07:00
|
|
|
onlySelf?: boolean;
|
|
|
|
|
emitEvent?: boolean;
|
|
|
|
|
emitModelToViewChange?: boolean;
|
|
|
|
|
emitViewToModelChange?: boolean;
|
|
|
|
|
}): void;
|
2016-06-22 14:56:10 -07:00
|
|
|
}
|
|
|
|
|
|
2021-11-30 14:46:46 -05:00
|
|
|
// @public (undocumented)
|
|
|
|
|
export const FormControl: ɵFormControlCtor;
|
|
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public
|
|
|
|
|
export class FormControlDirective extends NgControl implements OnChanges, OnDestroy {
|
|
|
|
|
constructor(validators: (Validator | ValidatorFn)[], asyncValidators: (AsyncValidator | AsyncValidatorFn)[], valueAccessors: ControlValueAccessor[], _ngModelWarningConfig: string | null);
|
2019-11-09 20:36:22 +02:00
|
|
|
get control(): FormControl;
|
2016-06-22 14:56:10 -07:00
|
|
|
form: FormControl;
|
2019-11-09 20:36:22 +02:00
|
|
|
set isDisabled(isDisabled: boolean);
|
2021-06-28 19:54:20 +02:00
|
|
|
// @deprecated (undocumented)
|
|
|
|
|
model: any;
|
|
|
|
|
// (undocumented)
|
2016-06-22 14:56:10 -07:00
|
|
|
ngOnChanges(changes: SimpleChanges): void;
|
2021-06-28 19:54:20 +02:00
|
|
|
// (undocumented)
|
2020-06-12 16:22:22 -07:00
|
|
|
ngOnDestroy(): void;
|
2021-06-28 19:54:20 +02:00
|
|
|
get path(): string[];
|
|
|
|
|
// @deprecated (undocumented)
|
|
|
|
|
update: EventEmitter<any>;
|
|
|
|
|
viewModel: any;
|
2016-06-22 14:56:10 -07:00
|
|
|
viewToModelUpdate(newValue: any): void;
|
2021-09-19 20:38:34 +02:00
|
|
|
// (undocumented)
|
|
|
|
|
static ɵdir: i0.ɵɵDirectiveDeclaration<FormControlDirective, "[formControl]", ["ngForm"], { "form": "formControl"; "isDisabled": "disabled"; "model": "ngModel"; }, { "update": "ngModelChange"; }, never>;
|
|
|
|
|
// (undocumented)
|
|
|
|
|
static ɵfac: i0.ɵɵFactoryDeclaration<FormControlDirective, [{ optional: true; self: true; }, { optional: true; self: true; }, { optional: true; self: true; }, { optional: true; }]>;
|
2016-06-22 14:56:10 -07:00
|
|
|
}
|
|
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public
|
|
|
|
|
export class FormControlName extends NgControl implements OnChanges, OnDestroy {
|
|
|
|
|
constructor(parent: ControlContainer, validators: (Validator | ValidatorFn)[], asyncValidators: (AsyncValidator | AsyncValidatorFn)[], valueAccessors: ControlValueAccessor[], _ngModelWarningConfig: string | null);
|
2017-02-07 19:27:01 -08:00
|
|
|
readonly control: FormControl;
|
2019-11-09 20:36:22 +02:00
|
|
|
get formDirective(): any;
|
|
|
|
|
set isDisabled(isDisabled: boolean);
|
2021-06-28 19:54:20 +02:00
|
|
|
// @deprecated (undocumented)
|
|
|
|
|
model: any;
|
2019-05-22 10:22:13 +02:00
|
|
|
name: string | number | null;
|
2021-06-28 19:54:20 +02:00
|
|
|
// (undocumented)
|
2016-06-22 14:56:10 -07:00
|
|
|
ngOnChanges(changes: SimpleChanges): void;
|
2021-06-28 19:54:20 +02:00
|
|
|
// (undocumented)
|
2016-06-22 14:56:10 -07:00
|
|
|
ngOnDestroy(): void;
|
2021-06-28 19:54:20 +02:00
|
|
|
get path(): string[];
|
|
|
|
|
// @deprecated (undocumented)
|
|
|
|
|
update: EventEmitter<any>;
|
2016-06-22 14:56:10 -07:00
|
|
|
viewToModelUpdate(newValue: any): void;
|
2021-09-19 20:38:34 +02:00
|
|
|
// (undocumented)
|
|
|
|
|
static ɵdir: i0.ɵɵDirectiveDeclaration<FormControlName, "[formControlName]", never, { "name": "formControlName"; "isDisabled": "disabled"; "model": "ngModel"; }, { "update": "ngModelChange"; }, never>;
|
|
|
|
|
// (undocumented)
|
|
|
|
|
static ɵfac: i0.ɵɵFactoryDeclaration<FormControlName, [{ optional: true; host: true; skipSelf: true; }, { optional: true; self: true; }, { optional: true; self: true; }, { optional: true; self: true; }, { optional: true; }]>;
|
2021-12-10 13:56:17 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// @public
|
|
|
|
|
export interface FormControlOptions extends AbstractControlOptions {
|
|
|
|
|
initialValueIsDefault?: boolean;
|
2016-06-22 14:56:10 -07:00
|
|
|
}
|
|
|
|
|
|
2021-11-15 14:17:39 -08:00
|
|
|
// @public
|
|
|
|
|
export type FormControlStatus = 'VALID' | 'INVALID' | 'PENDING' | 'DISABLED';
|
|
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public
|
|
|
|
|
export class FormGroup extends AbstractControl {
|
2016-06-22 14:56:10 -07:00
|
|
|
constructor(controls: {
|
|
|
|
|
[key: string]: AbstractControl;
|
2017-07-25 15:01:04 -07:00
|
|
|
}, validatorOrOpts?: ValidatorFn | ValidatorFn[] | AbstractControlOptions | null, asyncValidator?: AsyncValidatorFn | AsyncValidatorFn[] | null);
|
2021-02-11 12:01:32 +00:00
|
|
|
addControl(name: string, control: AbstractControl, options?: {
|
|
|
|
|
emitEvent?: boolean;
|
|
|
|
|
}): void;
|
2016-06-22 14:56:10 -07:00
|
|
|
contains(controlName: string): boolean;
|
2021-06-28 19:54:20 +02:00
|
|
|
// (undocumented)
|
|
|
|
|
controls: {
|
|
|
|
|
[key: string]: AbstractControl;
|
|
|
|
|
};
|
2016-11-09 02:44:36 +03:00
|
|
|
getRawValue(): any;
|
2016-08-05 13:35:17 -07:00
|
|
|
patchValue(value: {
|
|
|
|
|
[key: string]: any;
|
2017-04-27 13:39:21 -07:00
|
|
|
}, options?: {
|
2016-08-05 13:35:17 -07:00
|
|
|
onlySelf?: boolean;
|
2016-10-19 18:54:54 +02:00
|
|
|
emitEvent?: boolean;
|
2016-08-05 13:35:17 -07:00
|
|
|
}): void;
|
2016-06-23 18:19:32 -07:00
|
|
|
registerControl(name: string, control: AbstractControl): AbstractControl;
|
2021-02-11 12:01:32 +00:00
|
|
|
removeControl(name: string, options?: {
|
|
|
|
|
emitEvent?: boolean;
|
|
|
|
|
}): void;
|
2017-04-27 13:39:21 -07:00
|
|
|
reset(value?: any, options?: {
|
2016-07-12 15:02:25 -07:00
|
|
|
onlySelf?: boolean;
|
2016-10-19 18:54:54 +02:00
|
|
|
emitEvent?: boolean;
|
2016-07-12 15:02:25 -07:00
|
|
|
}): void;
|
2021-02-11 12:01:32 +00:00
|
|
|
setControl(name: string, control: AbstractControl, options?: {
|
|
|
|
|
emitEvent?: boolean;
|
|
|
|
|
}): void;
|
2016-08-05 13:35:17 -07:00
|
|
|
setValue(value: {
|
2016-07-08 13:04:25 -07:00
|
|
|
[key: string]: any;
|
2017-04-27 13:39:21 -07:00
|
|
|
}, options?: {
|
2016-07-08 13:04:25 -07:00
|
|
|
onlySelf?: boolean;
|
2016-10-19 18:54:54 +02:00
|
|
|
emitEvent?: boolean;
|
2016-07-08 13:04:25 -07:00
|
|
|
}): void;
|
2016-06-22 14:56:10 -07:00
|
|
|
}
|
|
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public
|
|
|
|
|
export class FormGroupDirective extends ControlContainer implements Form, OnChanges, OnDestroy {
|
2020-07-27 19:31:40 -07:00
|
|
|
constructor(validators: (Validator | ValidatorFn)[], asyncValidators: (AsyncValidator | AsyncValidatorFn)[]);
|
2016-09-02 15:57:35 -07:00
|
|
|
addControl(dir: FormControlName): FormControl;
|
2016-06-25 13:27:29 -07:00
|
|
|
addFormArray(dir: FormArrayName): void;
|
2016-06-23 18:19:32 -07:00
|
|
|
addFormGroup(dir: FormGroupName): void;
|
2021-06-28 19:54:20 +02:00
|
|
|
get control(): FormGroup;
|
|
|
|
|
directives: FormControlName[];
|
|
|
|
|
form: FormGroup;
|
|
|
|
|
get formDirective(): Form;
|
2016-09-02 15:57:35 -07:00
|
|
|
getControl(dir: FormControlName): FormControl;
|
2016-06-25 13:27:29 -07:00
|
|
|
getFormArray(dir: FormArrayName): FormArray;
|
2016-06-23 18:19:32 -07:00
|
|
|
getFormGroup(dir: FormGroupName): FormGroup;
|
2021-06-28 19:54:20 +02:00
|
|
|
// (undocumented)
|
2016-06-23 18:19:32 -07:00
|
|
|
ngOnChanges(changes: SimpleChanges): void;
|
2021-06-28 19:54:20 +02:00
|
|
|
// (undocumented)
|
2020-06-12 16:22:22 -07:00
|
|
|
ngOnDestroy(): void;
|
2021-06-28 19:54:20 +02:00
|
|
|
ngSubmit: EventEmitter<any>;
|
2016-07-12 15:02:25 -07:00
|
|
|
onReset(): void;
|
2016-10-11 23:49:36 +01:00
|
|
|
onSubmit($event: Event): boolean;
|
2021-06-28 19:54:20 +02:00
|
|
|
get path(): string[];
|
2016-09-02 15:57:35 -07:00
|
|
|
removeControl(dir: FormControlName): void;
|
2016-06-25 13:27:29 -07:00
|
|
|
removeFormArray(dir: FormArrayName): void;
|
2016-06-22 14:56:10 -07:00
|
|
|
removeFormGroup(dir: FormGroupName): void;
|
2016-08-11 23:27:33 -07:00
|
|
|
resetForm(value?: any): void;
|
2021-06-28 19:54:20 +02:00
|
|
|
readonly submitted: boolean;
|
2016-09-02 15:57:35 -07:00
|
|
|
updateModel(dir: FormControlName, value: any): void;
|
2021-09-19 20:38:34 +02:00
|
|
|
// (undocumented)
|
|
|
|
|
static ɵdir: i0.ɵɵDirectiveDeclaration<FormGroupDirective, "[formGroup]", ["ngForm"], { "form": "formGroup"; }, { "ngSubmit": "ngSubmit"; }, never>;
|
|
|
|
|
// (undocumented)
|
|
|
|
|
static ɵfac: i0.ɵɵFactoryDeclaration<FormGroupDirective, [{ optional: true; self: true; }, { optional: true; self: true; }]>;
|
2021-06-11 19:32:47 +05:30
|
|
|
}
|
2016-06-22 14:56:10 -07:00
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public
|
|
|
|
|
export class FormGroupName extends AbstractFormGroupDirective implements OnInit, OnDestroy {
|
2020-09-22 18:00:37 -07:00
|
|
|
constructor(parent: ControlContainer, validators: (Validator | ValidatorFn)[], asyncValidators: (AsyncValidator | AsyncValidatorFn)[]);
|
2021-06-28 19:54:20 +02:00
|
|
|
name: string | number | null;
|
2021-09-19 20:38:34 +02:00
|
|
|
// (undocumented)
|
|
|
|
|
static ɵdir: i0.ɵɵDirectiveDeclaration<FormGroupName, "[formGroupName]", never, { "name": "formGroupName"; }, {}, never>;
|
|
|
|
|
// (undocumented)
|
|
|
|
|
static ɵfac: i0.ɵɵFactoryDeclaration<FormGroupName, [{ optional: true; host: true; skipSelf: true; }, { optional: true; self: true; }, { optional: true; self: true; }]>;
|
2016-06-22 14:56:10 -07:00
|
|
|
}
|
|
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public
|
|
|
|
|
export class FormsModule {
|
2021-09-19 20:38:34 +02:00
|
|
|
// (undocumented)
|
|
|
|
|
static ɵfac: i0.ɵɵFactoryDeclaration<FormsModule, never>;
|
|
|
|
|
// (undocumented)
|
|
|
|
|
static ɵinj: i0.ɵɵInjectorDeclaration<FormsModule>;
|
|
|
|
|
// (undocumented)
|
|
|
|
|
static ɵmod: i0.ɵɵNgModuleDeclaration<FormsModule, [typeof i1_2.NgModel, typeof i2_2.NgModelGroup, typeof i3_2.NgForm], never, [typeof i4_2.ɵInternalFormsSharedModule, typeof i1_2.NgModel, typeof i2_2.NgModelGroup, typeof i3_2.NgForm]>;
|
feat(forms): add modules for forms and deprecatedForms (#9859)
Closes #9732
BREAKING CHANGE:
We have removed the deprecated form directives from the built-in platform directive list, so apps are not required to package forms with their app. This also makes forms friendly to offline compilation.
Instead, we have exposed three modules:
OLD API:
- `DeprecatedFormsModule`
NEW API:
- `FormsModule`
- `ReactiveFormsModule`
If you provide one of these modules, the default forms directives and providers from that module will be available to you app-wide. Note: You can provide both the `FormsModule` and the `ReactiveFormsModule` together if you like, but they are fully-functional separately.
**Before:**
```ts
import {disableDeprecatedForms, provideForms} from @angular/forms;
bootstrap(App, [
disableDeprecatedForms(),
provideForms()
]);
```
**After:**
```ts
import {DeprecatedFormsModule} from @angular/common;
bootstrap(App, {modules: [DeprecatedFormsModule] });
```
-OR-
```ts
import {FormsModule} from @angular/forms;
bootstrap(App, {modules: [FormsModule] });
```
-OR-
```ts
import {ReactiveFormsModule} from @angular/forms;
bootstrap(App, {modules: [ReactiveFormsModule] });
```
You can also choose not to provide any forms module and run your app without forms.
Or you can choose not to provide any forms module *and* provide form directives at will. This will allow you to use the deprecatedForms API for some components and not others.
```
import {FORM_DIRECTIVES, FORM_PROVIDERS} from @angular/forms;
@Component({
selector: some-comp,
directives: [FORM_DIRECTIVES],
providers: [FORM_PROVIDERS]
})
class SomeComp
```
2016-07-07 11:32:51 -07:00
|
|
|
}
|
|
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public
|
2021-10-25 21:15:41 -07:00
|
|
|
export class MaxLengthValidator extends AbstractValidatorDirective {
|
2021-06-11 19:32:47 +05:30
|
|
|
maxlength: string | number | null;
|
2021-06-28 19:54:20 +02:00
|
|
|
// (undocumented)
|
2021-09-19 20:38:34 +02:00
|
|
|
static ɵdir: i0.ɵɵDirectiveDeclaration<MaxLengthValidator, "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", never, { "maxlength": "maxlength"; }, {}, never>;
|
|
|
|
|
// (undocumented)
|
|
|
|
|
static ɵfac: i0.ɵɵFactoryDeclaration<MaxLengthValidator, never>;
|
2021-06-11 19:32:47 +05:30
|
|
|
}
|
2016-06-22 14:56:10 -07:00
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public
|
2021-10-25 21:15:41 -07:00
|
|
|
export class MaxValidator extends AbstractValidatorDirective {
|
2021-07-28 19:43:33 +05:30
|
|
|
max: string | number | null;
|
2021-09-19 20:38:34 +02:00
|
|
|
// (undocumented)
|
|
|
|
|
static ɵdir: i0.ɵɵDirectiveDeclaration<MaxValidator, "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", never, { "max": "max"; }, {}, never>;
|
|
|
|
|
// (undocumented)
|
|
|
|
|
static ɵfac: i0.ɵɵFactoryDeclaration<MaxValidator, never>;
|
2020-09-30 12:17:04 -04:00
|
|
|
}
|
|
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public
|
2021-10-25 21:15:41 -07:00
|
|
|
export class MinLengthValidator extends AbstractValidatorDirective {
|
2021-06-11 19:32:47 +05:30
|
|
|
minlength: string | number | null;
|
2021-06-28 19:54:20 +02:00
|
|
|
// (undocumented)
|
2021-09-19 20:38:34 +02:00
|
|
|
static ɵdir: i0.ɵɵDirectiveDeclaration<MinLengthValidator, "[minlength][formControlName],[minlength][formControl],[minlength][ngModel]", never, { "minlength": "minlength"; }, {}, never>;
|
|
|
|
|
// (undocumented)
|
|
|
|
|
static ɵfac: i0.ɵɵFactoryDeclaration<MinLengthValidator, never>;
|
2021-06-11 19:32:47 +05:30
|
|
|
}
|
2020-09-30 12:17:04 -04:00
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public
|
2021-10-25 21:15:41 -07:00
|
|
|
export class MinValidator extends AbstractValidatorDirective {
|
2021-07-28 19:43:33 +05:30
|
|
|
min: string | number | null;
|
2021-09-19 20:38:34 +02:00
|
|
|
// (undocumented)
|
|
|
|
|
static ɵdir: i0.ɵɵDirectiveDeclaration<MinValidator, "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", never, { "min": "min"; }, {}, never>;
|
|
|
|
|
// (undocumented)
|
|
|
|
|
static ɵfac: i0.ɵɵFactoryDeclaration<MinValidator, never>;
|
2020-09-30 12:17:04 -04:00
|
|
|
}
|
2016-06-22 14:56:10 -07:00
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public
|
|
|
|
|
export const NG_ASYNC_VALIDATORS: InjectionToken<(Function | Validator)[]>;
|
2016-06-22 14:56:10 -07:00
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public
|
|
|
|
|
export const NG_VALIDATORS: InjectionToken<(Function | Validator)[]>;
|
2016-06-22 14:56:10 -07:00
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public
|
|
|
|
|
export const NG_VALUE_ACCESSOR: InjectionToken<readonly ControlValueAccessor[]>;
|
2016-06-22 14:56:10 -07:00
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public
|
|
|
|
|
export abstract class NgControl extends AbstractControlDirective {
|
2019-05-22 10:22:13 +02:00
|
|
|
name: string | number | null;
|
2017-04-17 11:13:30 -07:00
|
|
|
valueAccessor: ControlValueAccessor | null;
|
2016-06-22 14:56:10 -07:00
|
|
|
abstract viewToModelUpdate(newValue: any): void;
|
|
|
|
|
}
|
|
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public
|
2021-09-19 20:38:34 +02:00
|
|
|
export class NgControlStatus extends AbstractControlStatus {
|
2016-06-23 18:19:32 -07:00
|
|
|
constructor(cd: NgControl);
|
2021-09-19 20:38:34 +02:00
|
|
|
// (undocumented)
|
|
|
|
|
static ɵdir: i0.ɵɵDirectiveDeclaration<NgControlStatus, "[formControlName],[ngModel],[formControl]", never, {}, {}, never>;
|
|
|
|
|
// (undocumented)
|
|
|
|
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgControlStatus, [{ self: true; }]>;
|
2016-06-22 14:56:10 -07:00
|
|
|
}
|
|
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public
|
2021-09-19 20:38:34 +02:00
|
|
|
export class NgControlStatusGroup extends AbstractControlStatus {
|
2016-08-11 09:01:09 -07:00
|
|
|
constructor(cd: ControlContainer);
|
2021-09-19 20:38:34 +02:00
|
|
|
// (undocumented)
|
|
|
|
|
static ɵdir: i0.ɵɵDirectiveDeclaration<NgControlStatusGroup, "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]", never, {}, {}, never>;
|
|
|
|
|
// (undocumented)
|
|
|
|
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgControlStatusGroup, [{ optional: true; self: true; }]>;
|
2016-08-11 09:01:09 -07:00
|
|
|
}
|
|
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public
|
|
|
|
|
export class NgForm extends ControlContainer implements Form, AfterViewInit {
|
|
|
|
|
constructor(validators: (Validator | ValidatorFn)[], asyncValidators: (AsyncValidator | AsyncValidatorFn)[]);
|
|
|
|
|
addControl(dir: NgModel): void;
|
|
|
|
|
addFormGroup(dir: NgModelGroup): void;
|
2019-11-09 20:36:22 +02:00
|
|
|
get control(): FormGroup;
|
|
|
|
|
get controls(): {
|
2016-06-22 14:56:10 -07:00
|
|
|
[key: string]: AbstractControl;
|
|
|
|
|
};
|
2016-06-23 18:19:32 -07:00
|
|
|
form: FormGroup;
|
2019-11-09 20:36:22 +02:00
|
|
|
get formDirective(): Form;
|
2016-06-22 14:56:10 -07:00
|
|
|
getControl(dir: NgModel): FormControl;
|
2016-06-23 18:19:32 -07:00
|
|
|
getFormGroup(dir: NgModelGroup): FormGroup;
|
2021-06-28 19:54:20 +02:00
|
|
|
// (undocumented)
|
2017-08-08 14:37:29 -07:00
|
|
|
ngAfterViewInit(): void;
|
2021-06-28 19:54:20 +02:00
|
|
|
ngSubmit: EventEmitter<any>;
|
2016-07-12 15:02:25 -07:00
|
|
|
onReset(): void;
|
2016-10-11 23:49:36 +01:00
|
|
|
onSubmit($event: Event): boolean;
|
2021-06-28 19:54:20 +02:00
|
|
|
options: {
|
|
|
|
|
updateOn?: FormHooks;
|
|
|
|
|
};
|
|
|
|
|
get path(): string[];
|
2016-06-22 14:56:10 -07:00
|
|
|
removeControl(dir: NgModel): void;
|
|
|
|
|
removeFormGroup(dir: NgModelGroup): void;
|
2016-08-11 23:27:33 -07:00
|
|
|
resetForm(value?: any): void;
|
2016-08-05 13:35:17 -07:00
|
|
|
setValue(value: {
|
2016-07-08 13:04:25 -07:00
|
|
|
[key: string]: any;
|
|
|
|
|
}): void;
|
2021-06-28 19:54:20 +02:00
|
|
|
readonly submitted: boolean;
|
2016-08-05 13:35:17 -07:00
|
|
|
updateModel(dir: NgControl, value: any): void;
|
2021-09-19 20:38:34 +02:00
|
|
|
// (undocumented)
|
|
|
|
|
static ɵdir: i0.ɵɵDirectiveDeclaration<NgForm, "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", ["ngForm"], { "options": "ngFormOptions"; }, { "ngSubmit": "ngSubmit"; }, never>;
|
|
|
|
|
// (undocumented)
|
|
|
|
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgForm, [{ optional: true; self: true; }, { optional: true; self: true; }]>;
|
2016-06-22 14:56:10 -07:00
|
|
|
}
|
|
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public
|
|
|
|
|
export class NgModel extends NgControl implements OnChanges, OnDestroy {
|
2022-01-29 06:44:34 +02:00
|
|
|
constructor(parent: ControlContainer, validators: (Validator | ValidatorFn)[], asyncValidators: (AsyncValidator | AsyncValidatorFn)[], valueAccessors: ControlValueAccessor[], _changeDetectorRef?: ChangeDetectorRef | null | undefined);
|
2021-06-28 19:54:20 +02:00
|
|
|
// (undocumented)
|
2017-02-07 19:27:01 -08:00
|
|
|
readonly control: FormControl;
|
2019-11-09 20:36:22 +02:00
|
|
|
get formDirective(): any;
|
2016-08-25 14:56:31 -07:00
|
|
|
isDisabled: boolean;
|
2016-06-22 14:56:10 -07:00
|
|
|
model: any;
|
|
|
|
|
name: string;
|
2021-06-28 19:54:20 +02:00
|
|
|
// (undocumented)
|
|
|
|
|
static ngAcceptInputType_isDisabled: boolean | string;
|
|
|
|
|
// (undocumented)
|
|
|
|
|
ngOnChanges(changes: SimpleChanges): void;
|
|
|
|
|
// (undocumented)
|
|
|
|
|
ngOnDestroy(): void;
|
2016-06-22 14:56:10 -07:00
|
|
|
options: {
|
|
|
|
|
name?: string;
|
|
|
|
|
standalone?: boolean;
|
2017-08-07 21:11:46 -07:00
|
|
|
updateOn?: FormHooks;
|
2016-06-22 14:56:10 -07:00
|
|
|
};
|
2019-11-09 20:36:22 +02:00
|
|
|
get path(): string[];
|
2019-07-17 17:49:16 -07:00
|
|
|
update: EventEmitter<any>;
|
2016-06-23 18:19:32 -07:00
|
|
|
viewModel: any;
|
2016-06-22 14:56:10 -07:00
|
|
|
viewToModelUpdate(newValue: any): void;
|
2021-09-19 20:38:34 +02:00
|
|
|
// (undocumented)
|
|
|
|
|
static ɵdir: i0.ɵɵDirectiveDeclaration<NgModel, "[ngModel]:not([formControlName]):not([formControl])", ["ngModel"], { "name": "name"; "isDisabled": "disabled"; "model": "ngModel"; "options": "ngModelOptions"; }, { "update": "ngModelChange"; }, never>;
|
|
|
|
|
// (undocumented)
|
2022-01-29 06:44:34 +02:00
|
|
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgModel, [{ optional: true; host: true; }, { optional: true; self: true; }, { optional: true; self: true; }, { optional: true; self: true; }, { optional: true; }]>;
|
2016-06-22 14:56:10 -07:00
|
|
|
}
|
|
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public
|
|
|
|
|
export class NgModelGroup extends AbstractFormGroupDirective implements OnInit, OnDestroy {
|
2020-09-22 18:00:37 -07:00
|
|
|
constructor(parent: ControlContainer, validators: (Validator | ValidatorFn)[], asyncValidators: (AsyncValidator | AsyncValidatorFn)[]);
|
2021-06-28 19:54:20 +02:00
|
|
|
name: string;
|
2021-09-19 20:38:34 +02:00
|
|
|
// (undocumented)
|
|
|
|
|
static ɵdir: i0.ɵɵDirectiveDeclaration<NgModelGroup, "[ngModelGroup]", ["ngModelGroup"], { "name": "ngModelGroup"; }, {}, never>;
|
|
|
|
|
// (undocumented)
|
|
|
|
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgModelGroup, [{ host: true; skipSelf: true; }, { optional: true; self: true; }, { optional: true; self: true; }]>;
|
2016-06-22 14:56:10 -07:00
|
|
|
}
|
|
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public
|
|
|
|
|
export class NgSelectOption implements OnDestroy {
|
|
|
|
|
constructor(_element: ElementRef, _renderer: Renderer2, _select: SelectControlValueAccessor);
|
2016-06-22 14:56:10 -07:00
|
|
|
id: string;
|
2021-06-28 19:54:20 +02:00
|
|
|
// (undocumented)
|
|
|
|
|
ngOnDestroy(): void;
|
2019-11-09 20:36:22 +02:00
|
|
|
set ngValue(value: any);
|
|
|
|
|
set value(value: any);
|
2021-09-19 20:38:34 +02:00
|
|
|
// (undocumented)
|
|
|
|
|
static ɵdir: i0.ɵɵDirectiveDeclaration<NgSelectOption, "option", never, { "ngValue": "ngValue"; "value": "value"; }, {}, never>;
|
|
|
|
|
// (undocumented)
|
|
|
|
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgSelectOption, [null, null, { optional: true; host: true; }]>;
|
2016-06-22 14:56:10 -07:00
|
|
|
}
|
|
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public
|
2021-09-19 20:38:34 +02:00
|
|
|
export class NumberValueAccessor extends BuiltInControlValueAccessor implements ControlValueAccessor {
|
2018-12-13 11:11:15 -08:00
|
|
|
registerOnChange(fn: (_: number | null) => void): void;
|
|
|
|
|
writeValue(value: number): void;
|
2021-09-19 20:38:34 +02:00
|
|
|
// (undocumented)
|
|
|
|
|
static ɵdir: i0.ɵɵDirectiveDeclaration<NumberValueAccessor, "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]", never, {}, {}, never>;
|
|
|
|
|
// (undocumented)
|
|
|
|
|
static ɵfac: i0.ɵɵFactoryDeclaration<NumberValueAccessor, never>;
|
2018-12-13 11:11:15 -08:00
|
|
|
}
|
|
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public
|
2022-01-28 20:38:39 +05:30
|
|
|
export class PatternValidator extends AbstractValidatorDirective {
|
2021-06-28 19:54:20 +02:00
|
|
|
pattern: string | RegExp;
|
2021-09-19 20:38:34 +02:00
|
|
|
// (undocumented)
|
|
|
|
|
static ɵdir: i0.ɵɵDirectiveDeclaration<PatternValidator, "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", never, { "pattern": "pattern"; }, {}, never>;
|
|
|
|
|
// (undocumented)
|
|
|
|
|
static ɵfac: i0.ɵɵFactoryDeclaration<PatternValidator, never>;
|
2021-06-11 19:32:47 +05:30
|
|
|
}
|
2016-06-22 14:56:10 -07:00
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public
|
2021-09-19 20:38:34 +02:00
|
|
|
export class RadioControlValueAccessor extends BuiltInControlValueAccessor implements ControlValueAccessor, OnDestroy, OnInit {
|
|
|
|
|
constructor(renderer: Renderer2, elementRef: ElementRef, _registry: RadioControlRegistry, _injector: Injector);
|
2016-09-19 10:41:20 -07:00
|
|
|
fireUncheck(value: any): void;
|
2021-06-28 19:54:20 +02:00
|
|
|
formControlName: string;
|
|
|
|
|
name: string;
|
|
|
|
|
// (undocumented)
|
2016-09-19 10:41:20 -07:00
|
|
|
ngOnDestroy(): void;
|
2021-06-28 19:54:20 +02:00
|
|
|
// (undocumented)
|
2016-09-19 10:41:20 -07:00
|
|
|
ngOnInit(): void;
|
2021-06-28 19:54:20 +02:00
|
|
|
onChange: () => void;
|
2016-09-19 10:41:20 -07:00
|
|
|
registerOnChange(fn: (_: any) => {}): void;
|
2021-06-28 19:54:20 +02:00
|
|
|
value: any;
|
2016-09-19 10:41:20 -07:00
|
|
|
writeValue(value: any): void;
|
2021-09-19 20:38:34 +02:00
|
|
|
// (undocumented)
|
|
|
|
|
static ɵdir: i0.ɵɵDirectiveDeclaration<RadioControlValueAccessor, "input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]", never, { "name": "name"; "formControlName": "formControlName"; "value": "value"; }, {}, never>;
|
|
|
|
|
// (undocumented)
|
|
|
|
|
static ɵfac: i0.ɵɵFactoryDeclaration<RadioControlValueAccessor, never>;
|
2016-09-19 10:41:20 -07:00
|
|
|
}
|
|
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public
|
2021-09-19 20:38:34 +02:00
|
|
|
export class RangeValueAccessor extends BuiltInControlValueAccessor implements ControlValueAccessor {
|
2018-12-13 11:11:15 -08:00
|
|
|
registerOnChange(fn: (_: number | null) => void): void;
|
|
|
|
|
writeValue(value: any): void;
|
2021-09-19 20:38:34 +02:00
|
|
|
// (undocumented)
|
|
|
|
|
static ɵdir: i0.ɵɵDirectiveDeclaration<RangeValueAccessor, "input[type=range][formControlName],input[type=range][formControl],input[type=range][ngModel]", never, {}, {}, never>;
|
|
|
|
|
// (undocumented)
|
|
|
|
|
static ɵfac: i0.ɵɵFactoryDeclaration<RangeValueAccessor, never>;
|
2018-12-13 11:11:15 -08:00
|
|
|
}
|
|
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public
|
|
|
|
|
export class ReactiveFormsModule {
|
|
|
|
|
static withConfig(opts: {
|
|
|
|
|
warnOnNgModelWithFormControl: 'never' | 'once' | 'always';
|
2018-07-09 11:36:30 -07:00
|
|
|
}): ModuleWithProviders<ReactiveFormsModule>;
|
2021-09-19 20:38:34 +02:00
|
|
|
// (undocumented)
|
|
|
|
|
static ɵfac: i0.ɵɵFactoryDeclaration<ReactiveFormsModule, never>;
|
|
|
|
|
// (undocumented)
|
|
|
|
|
static ɵinj: i0.ɵɵInjectorDeclaration<ReactiveFormsModule>;
|
|
|
|
|
// (undocumented)
|
|
|
|
|
static ɵmod: i0.ɵɵNgModuleDeclaration<ReactiveFormsModule, [typeof i5_2.FormControlDirective, typeof i6_2.FormGroupDirective, typeof i7_2.FormControlName, typeof i8_2.FormGroupName, typeof i8_2.FormArrayName], never, [typeof i4_2.ɵInternalFormsSharedModule, typeof i5_2.FormControlDirective, typeof i6_2.FormGroupDirective, typeof i7_2.FormControlName, typeof i8_2.FormGroupName, typeof i8_2.FormArrayName]>;
|
feat(forms): add modules for forms and deprecatedForms (#9859)
Closes #9732
BREAKING CHANGE:
We have removed the deprecated form directives from the built-in platform directive list, so apps are not required to package forms with their app. This also makes forms friendly to offline compilation.
Instead, we have exposed three modules:
OLD API:
- `DeprecatedFormsModule`
NEW API:
- `FormsModule`
- `ReactiveFormsModule`
If you provide one of these modules, the default forms directives and providers from that module will be available to you app-wide. Note: You can provide both the `FormsModule` and the `ReactiveFormsModule` together if you like, but they are fully-functional separately.
**Before:**
```ts
import {disableDeprecatedForms, provideForms} from @angular/forms;
bootstrap(App, [
disableDeprecatedForms(),
provideForms()
]);
```
**After:**
```ts
import {DeprecatedFormsModule} from @angular/common;
bootstrap(App, {modules: [DeprecatedFormsModule] });
```
-OR-
```ts
import {FormsModule} from @angular/forms;
bootstrap(App, {modules: [FormsModule] });
```
-OR-
```ts
import {ReactiveFormsModule} from @angular/forms;
bootstrap(App, {modules: [ReactiveFormsModule] });
```
You can also choose not to provide any forms module and run your app without forms.
Or you can choose not to provide any forms module *and* provide form directives at will. This will allow you to use the deprecatedForms API for some components and not others.
```
import {FORM_DIRECTIVES, FORM_PROVIDERS} from @angular/forms;
@Component({
selector: some-comp,
directives: [FORM_DIRECTIVES],
providers: [FORM_PROVIDERS]
})
class SomeComp
```
2016-07-07 11:32:51 -07:00
|
|
|
}
|
2016-06-22 14:56:10 -07:00
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public
|
2021-11-13 11:40:49 +05:30
|
|
|
export class RequiredValidator extends AbstractValidatorDirective {
|
|
|
|
|
// (undocumented)
|
|
|
|
|
enabled(input: boolean): boolean;
|
|
|
|
|
required: boolean | string;
|
2021-09-19 20:38:34 +02:00
|
|
|
// (undocumented)
|
|
|
|
|
static ɵdir: i0.ɵɵDirectiveDeclaration<RequiredValidator, ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", never, { "required": "required"; }, {}, never>;
|
|
|
|
|
// (undocumented)
|
|
|
|
|
static ɵfac: i0.ɵɵFactoryDeclaration<RequiredValidator, never>;
|
2016-06-22 14:56:10 -07:00
|
|
|
}
|
|
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public
|
2021-09-19 20:38:34 +02:00
|
|
|
export class SelectControlValueAccessor extends BuiltInControlValueAccessor implements ControlValueAccessor {
|
2019-11-09 20:36:22 +02:00
|
|
|
set compareWith(fn: (o1: any, o2: any) => boolean);
|
2016-06-22 14:56:10 -07:00
|
|
|
registerOnChange(fn: (value: any) => any): void;
|
2021-06-28 19:54:20 +02:00
|
|
|
// (undocumented)
|
|
|
|
|
value: any;
|
2016-06-23 18:19:32 -07:00
|
|
|
writeValue(value: any): void;
|
2021-09-19 20:38:34 +02:00
|
|
|
// (undocumented)
|
|
|
|
|
static ɵdir: i0.ɵɵDirectiveDeclaration<SelectControlValueAccessor, "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", never, { "compareWith": "compareWith"; }, {}, never>;
|
|
|
|
|
// (undocumented)
|
|
|
|
|
static ɵfac: i0.ɵɵFactoryDeclaration<SelectControlValueAccessor, never>;
|
2016-06-22 14:56:10 -07:00
|
|
|
}
|
|
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public
|
2021-09-19 20:38:34 +02:00
|
|
|
export class SelectMultipleControlValueAccessor extends BuiltInControlValueAccessor implements ControlValueAccessor {
|
2019-11-09 20:36:22 +02:00
|
|
|
set compareWith(fn: (o1: any, o2: any) => boolean);
|
2016-06-30 18:04:00 -07:00
|
|
|
registerOnChange(fn: (value: any) => any): void;
|
2021-06-28 19:54:20 +02:00
|
|
|
value: any;
|
2016-06-30 18:04:00 -07:00
|
|
|
writeValue(value: any): void;
|
2021-09-19 20:38:34 +02:00
|
|
|
// (undocumented)
|
|
|
|
|
static ɵdir: i0.ɵɵDirectiveDeclaration<SelectMultipleControlValueAccessor, "select[multiple][formControlName],select[multiple][formControl],select[multiple][ngModel]", never, { "compareWith": "compareWith"; }, {}, never>;
|
|
|
|
|
// (undocumented)
|
|
|
|
|
static ɵfac: i0.ɵɵFactoryDeclaration<SelectMultipleControlValueAccessor, never>;
|
2016-06-30 18:04:00 -07:00
|
|
|
}
|
|
|
|
|
|
2022-02-25 09:47:45 -08:00
|
|
|
// @public
|
|
|
|
|
export type UntypedFormArray = FormArray;
|
|
|
|
|
|
|
|
|
|
// @public (undocumented)
|
|
|
|
|
export const UntypedFormArray: UntypedFormArrayCtor;
|
|
|
|
|
|
2022-03-03 09:37:32 -08:00
|
|
|
// @public
|
2022-03-23 11:28:04 -07:00
|
|
|
export class UntypedFormBuilder extends FormBuilder {
|
2022-03-03 09:37:32 -08:00
|
|
|
// (undocumented)
|
|
|
|
|
array(controlsConfig: any[], validatorOrOpts?: ValidatorFn | ValidatorFn[] | AbstractControlOptions | null, asyncValidator?: AsyncValidatorFn | AsyncValidatorFn[] | null): UntypedFormArray;
|
|
|
|
|
// (undocumented)
|
|
|
|
|
control(formState: any, validatorOrOpts?: ValidatorFn | ValidatorFn[] | FormControlOptions | null, asyncValidator?: AsyncValidatorFn | AsyncValidatorFn[] | null): UntypedFormControl;
|
|
|
|
|
// (undocumented)
|
|
|
|
|
group(controlsConfig: {
|
|
|
|
|
[key: string]: any;
|
|
|
|
|
}, options?: AbstractControlOptions | null): UntypedFormGroup;
|
|
|
|
|
// @deprecated (undocumented)
|
|
|
|
|
group(controlsConfig: {
|
|
|
|
|
[key: string]: any;
|
|
|
|
|
}, options: {
|
|
|
|
|
[key: string]: any;
|
|
|
|
|
}): UntypedFormGroup;
|
|
|
|
|
// (undocumented)
|
|
|
|
|
static ɵfac: i0.ɵɵFactoryDeclaration<UntypedFormBuilder, never>;
|
|
|
|
|
// (undocumented)
|
|
|
|
|
static ɵprov: i0.ɵɵInjectableDeclaration<UntypedFormBuilder>;
|
|
|
|
|
}
|
|
|
|
|
|
2022-02-25 09:47:45 -08:00
|
|
|
// @public
|
|
|
|
|
export type UntypedFormControl = FormControl;
|
|
|
|
|
|
|
|
|
|
// @public (undocumented)
|
|
|
|
|
export const UntypedFormControl: UntypedFormControlCtor;
|
|
|
|
|
|
|
|
|
|
// @public
|
|
|
|
|
export type UntypedFormGroup = FormGroup;
|
|
|
|
|
|
|
|
|
|
// @public (undocumented)
|
|
|
|
|
export const UntypedFormGroup: UntypedFormGroupCtor;
|
|
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public
|
|
|
|
|
export type ValidationErrors = {
|
2017-02-23 20:53:29 +03:00
|
|
|
[key: string]: any;
|
|
|
|
|
};
|
|
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public
|
|
|
|
|
export interface Validator {
|
2016-09-09 14:09:11 -07:00
|
|
|
registerOnValidatorChange?(fn: () => void): void;
|
2018-09-20 15:18:14 +01:00
|
|
|
validate(control: AbstractControl): ValidationErrors | null;
|
2016-06-22 14:56:10 -07:00
|
|
|
}
|
|
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public
|
|
|
|
|
export interface ValidatorFn {
|
|
|
|
|
// (undocumented)
|
2018-09-20 15:18:14 +01:00
|
|
|
(control: AbstractControl): ValidationErrors | null;
|
2016-06-24 18:24:11 -07:00
|
|
|
}
|
|
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public
|
|
|
|
|
export class Validators {
|
2017-04-28 18:48:15 +02:00
|
|
|
static compose(validators: null): null;
|
2021-06-28 19:54:20 +02:00
|
|
|
// (undocumented)
|
2020-01-24 10:55:39 -08:00
|
|
|
static compose(validators: (ValidatorFn | null | undefined)[]): ValidatorFn | null;
|
2017-04-17 11:13:30 -07:00
|
|
|
static composeAsync(validators: (AsyncValidatorFn | null)[]): AsyncValidatorFn | null;
|
2017-02-23 20:53:29 +03:00
|
|
|
static email(control: AbstractControl): ValidationErrors | null;
|
2017-04-06 09:41:10 -06:00
|
|
|
static max(max: number): ValidatorFn;
|
2016-06-23 18:19:32 -07:00
|
|
|
static maxLength(maxLength: number): ValidatorFn;
|
2017-04-06 09:41:10 -06:00
|
|
|
static min(min: number): ValidatorFn;
|
2016-06-23 18:19:32 -07:00
|
|
|
static minLength(minLength: number): ValidatorFn;
|
2018-09-20 15:18:14 +01:00
|
|
|
static nullValidator(control: AbstractControl): ValidationErrors | null;
|
2016-10-19 19:37:54 +03:00
|
|
|
static pattern(pattern: string | RegExp): ValidatorFn;
|
2017-02-23 20:53:29 +03:00
|
|
|
static required(control: AbstractControl): ValidationErrors | null;
|
|
|
|
|
static requiredTrue(control: AbstractControl): ValidationErrors | null;
|
2016-06-22 14:56:10 -07:00
|
|
|
}
|
2016-11-30 13:52:08 -08:00
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public (undocumented)
|
|
|
|
|
export const VERSION: Version;
|
|
|
|
|
|
|
|
|
|
// (No @packageDocumentation comment for this package)
|
|
|
|
|
|
|
|
|
|
```
|