
committed by
Alex Rickabaugh

parent
3903e5ebe7
commit
982bc7f2aa
@ -16,6 +16,7 @@ import {ValidationErrors} from './validators';
|
||||
*
|
||||
* This class is only used internally in the `ReactiveFormsModule` and the `FormsModule`.
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export abstract class AbstractControlDirective {
|
||||
/**
|
||||
|
@ -21,6 +21,7 @@ import {AsyncValidatorFn, ValidatorFn} from './validators';
|
||||
* @description
|
||||
* A base class for code shared between the `NgModelGroup` and `FormGroupName` directives.
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export class AbstractFormGroupDirective extends ControlContainer implements OnInit, OnDestroy {
|
||||
/**
|
||||
|
@ -28,6 +28,7 @@ export const CHECKBOX_VALUE_ACCESSOR: any = {
|
||||
*
|
||||
* @ngModule FormsModule
|
||||
* @ngModule ReactiveFormsModule
|
||||
* @publicApi
|
||||
*/
|
||||
@Directive({
|
||||
selector:
|
||||
|
@ -14,6 +14,8 @@ import {Form} from './form_interface';
|
||||
* @description
|
||||
* A base class for directives that contain multiple registered instances of `NgControl`.
|
||||
* Only used by the forms module.
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export abstract class ControlContainer extends AbstractControlDirective {
|
||||
/**
|
||||
|
@ -17,6 +17,8 @@ import {InjectionToken} from '@angular/core';
|
||||
* that integrates with Angular forms.
|
||||
*
|
||||
* @see DefaultValueAccessor
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export interface ControlValueAccessor {
|
||||
/**
|
||||
@ -134,5 +136,6 @@ export interface ControlValueAccessor {
|
||||
*
|
||||
* See `DefaultValueAccessor` for how to implement one.
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export const NG_VALUE_ACCESSOR = new InjectionToken<ControlValueAccessor>('NgValueAccessor');
|
||||
|
@ -44,6 +44,7 @@ export const COMPOSITION_BUFFER_MODE = new InjectionToken<boolean>('CompositionE
|
||||
*
|
||||
* @ngModule FormsModule
|
||||
* @ngModule ReactiveFormsModule
|
||||
* @publicApi
|
||||
*/
|
||||
@Directive({
|
||||
selector:
|
||||
|
@ -18,6 +18,8 @@ import {NgControl} from './ng_control';
|
||||
* An interface implemented by `FormGroupDirective` and `NgForm` directives.
|
||||
*
|
||||
* Only used by the `ReactiveFormsModule` and `FormsModule`.
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export interface Form {
|
||||
/**
|
||||
|
@ -20,6 +20,8 @@ function unimplemented(): any {
|
||||
* @description
|
||||
* A base class that all control `FormControl`-based directives extend. It binds a `FormControl`
|
||||
* object to a DOM element.
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export abstract class NgControl extends AbstractControlDirective {
|
||||
/**
|
||||
|
@ -51,6 +51,7 @@ export const ngControlStatusHost = {
|
||||
*
|
||||
* @ngModule FormsModule
|
||||
* @ngModule ReactiveFormsModule
|
||||
* @publicApi
|
||||
*/
|
||||
@Directive({selector: '[formControlName],[ngModel],[formControl]', host: ngControlStatusHost})
|
||||
export class NgControlStatus extends AbstractControlStatus {
|
||||
@ -63,6 +64,7 @@ export class NgControlStatus extends AbstractControlStatus {
|
||||
*
|
||||
* @ngModule FormsModule
|
||||
* @ngModule ReactiveFormsModule
|
||||
* @publicApi
|
||||
*/
|
||||
@Directive({
|
||||
selector:
|
||||
|
@ -74,6 +74,7 @@ const resolvedPromise = Promise.resolve(null);
|
||||
* {@example forms/ts/simpleForm/simple_form_example.ts region='Component'}
|
||||
*
|
||||
* @ngModule FormsModule
|
||||
* @publicApi
|
||||
*/
|
||||
@Directive({
|
||||
selector: 'form:not([ngNoForm]):not([formGroup]),ngForm,ng-form,[ngForm]',
|
||||
|
@ -19,6 +19,7 @@ export const NG_FORM_SELECTOR_WARNING = new InjectionToken('NgFormSelectorWarnin
|
||||
*
|
||||
* @deprecated in Angular v6 and will be removed in Angular v9.
|
||||
* @ngModule FormsModule
|
||||
* @publicApi
|
||||
*/
|
||||
@Directive({selector: 'ngForm'})
|
||||
export class NgFormSelectorWarning {
|
||||
|
@ -98,6 +98,7 @@ const resolvedPromise = Promise.resolve(null);
|
||||
* * Selects: `SelectControlValueAccessor`
|
||||
*
|
||||
* @ngModule FormsModule
|
||||
* @publicApi
|
||||
*/
|
||||
@Directive({
|
||||
selector: '[ngModel]:not([formControlName]):not([formControl])',
|
||||
|
@ -40,6 +40,7 @@ export const modelGroupProvider: any = {
|
||||
* {@example forms/ts/ngModelGroup/ng_model_group_example.ts region='Component'}
|
||||
*
|
||||
* @ngModule FormsModule
|
||||
* @publicApi
|
||||
*/
|
||||
@Directive({selector: '[ngModelGroup]', providers: [modelGroupProvider], exportAs: 'ngModelGroup'})
|
||||
export class NgModelGroup extends AbstractFormGroupDirective implements OnInit, OnDestroy {
|
||||
|
@ -82,6 +82,7 @@ export class RadioControlRegistry {
|
||||
*
|
||||
* @ngModule FormsModule
|
||||
* @ngModule ReactiveFormsModule
|
||||
* @publicApi
|
||||
*/
|
||||
@Directive({
|
||||
selector:
|
||||
|
@ -133,6 +133,7 @@ export const formControlBinding: any = {
|
||||
* the pattern is being used as the code is being updated.
|
||||
*
|
||||
* @ngModule ReactiveFormsModule
|
||||
* @publicApi
|
||||
*/
|
||||
@Directive({selector: '[formControl]', providers: [formControlBinding], exportAs: 'ngForm'})
|
||||
|
||||
|
@ -145,6 +145,7 @@ export const controlNameBinding: any = {
|
||||
* the pattern is being used as the code is being updated.
|
||||
*
|
||||
* @ngModule ReactiveFormsModule
|
||||
* @publicApi
|
||||
*/
|
||||
@Directive({selector: '[formControlName]', providers: [controlNameBinding]})
|
||||
export class FormControlName extends NgControl implements OnChanges, OnDestroy {
|
||||
|
@ -54,6 +54,7 @@ export const formDirectiveProvider: any = {
|
||||
* {@example forms/ts/simpleFormGroup/simple_form_group_example.ts region='Component'}
|
||||
*
|
||||
* @ngModule ReactiveFormsModule
|
||||
* @publicApi
|
||||
*/
|
||||
@Directive({
|
||||
selector: '[formGroup]',
|
||||
|
@ -63,6 +63,7 @@ export const formGroupNameProvider: any = {
|
||||
* {@example forms/ts/nestedFormGroup/nested_form_group_example.ts region='Component'}
|
||||
*
|
||||
* @ngModule ReactiveFormsModule
|
||||
* @publicApi
|
||||
*/
|
||||
@Directive({selector: '[formGroupName]', providers: [formGroupNameProvider]})
|
||||
export class FormGroupName extends AbstractFormGroupDirective implements OnInit, OnDestroy {
|
||||
@ -135,6 +136,7 @@ export const formArrayNameProvider: any = {
|
||||
* {@example forms/ts/nestedFormArray/nested_form_array_example.ts region='Component'}
|
||||
*
|
||||
* @ngModule ReactiveFormsModule
|
||||
* @publicApi
|
||||
*/
|
||||
@Directive({selector: '[formArrayName]', providers: [formArrayNameProvider]})
|
||||
export class FormArrayName extends ControlContainer implements OnInit, OnDestroy {
|
||||
|
@ -88,6 +88,7 @@ function _extractId(valueString: string): string {
|
||||
*
|
||||
* @ngModule FormsModule
|
||||
* @ngModule ReactiveFormsModule
|
||||
* @publicApi
|
||||
*/
|
||||
@Directive({
|
||||
selector:
|
||||
@ -166,6 +167,7 @@ export class SelectControlValueAccessor implements ControlValueAccessor {
|
||||
*
|
||||
* @ngModule FormsModule
|
||||
* @ngModule ReactiveFormsModule
|
||||
* @publicApi
|
||||
*/
|
||||
@Directive({selector: 'option'})
|
||||
export class NgSelectOption implements OnDestroy {
|
||||
|
@ -71,6 +71,7 @@ abstract class HTMLCollection {
|
||||
*
|
||||
* @ngModule ReactiveFormsModule
|
||||
* @ngModule FormsModule
|
||||
* @publicApi
|
||||
*/
|
||||
@Directive({
|
||||
selector:
|
||||
|
@ -45,6 +45,8 @@ export type ValidationErrors = {
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export interface Validator {
|
||||
/**
|
||||
@ -135,6 +137,7 @@ export const CHECKBOX_REQUIRED_VALIDATOR: StaticProvider = {
|
||||
*
|
||||
* @ngModule FormsModule
|
||||
* @ngModule ReactiveFormsModule
|
||||
* @publicApi
|
||||
*/
|
||||
@Directive({
|
||||
selector:
|
||||
@ -240,8 +243,14 @@ export class EmailValidator implements Validator {
|
||||
registerOnValidatorChange(fn: () => void): void { this._onChange = fn; }
|
||||
}
|
||||
|
||||
/**
|
||||
* @publicApi
|
||||
*/
|
||||
export interface ValidatorFn { (control: AbstractControl): ValidationErrors|null; }
|
||||
|
||||
/**
|
||||
* @publicApi
|
||||
*/
|
||||
export interface AsyncValidatorFn {
|
||||
(control: AbstractControl): Promise<ValidationErrors|null>|Observable<ValidationErrors|null>;
|
||||
}
|
||||
@ -266,6 +275,7 @@ export const MIN_LENGTH_VALIDATOR: any = {
|
||||
*
|
||||
* @ngModule FormsModule
|
||||
* @ngModule ReactiveFormsModule
|
||||
* @publicApi
|
||||
*/
|
||||
@Directive({
|
||||
selector: '[minlength][formControlName],[minlength][formControl],[minlength][ngModel]',
|
||||
@ -320,6 +330,7 @@ export const MAX_LENGTH_VALIDATOR: any = {
|
||||
*
|
||||
* @ngModule FormsModule
|
||||
* @ngModule ReactiveFormsModule
|
||||
* @publicApi
|
||||
*/
|
||||
@Directive({
|
||||
selector: '[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]',
|
||||
@ -377,6 +388,7 @@ export const PATTERN_VALIDATOR: any = {
|
||||
*
|
||||
* @ngModule FormsModule
|
||||
* @ngModule ReactiveFormsModule
|
||||
* @publicApi
|
||||
*/
|
||||
@Directive({
|
||||
selector: '[pattern][formControlName],[pattern][formControl],[pattern][ngModel]',
|
||||
|
Reference in New Issue
Block a user