docs(forms): update form apis based on review feedback (#25724)
PR Close #25724
This commit is contained in:

committed by
Kara Erickson

parent
07c10e2844
commit
a9a81f91cf
@ -36,11 +36,11 @@ export type ValidationErrors = {
|
||||
*
|
||||
* ```typescript
|
||||
* @Directive({
|
||||
* selector: '[custom-validator]',
|
||||
* selector: '[customValidator]',
|
||||
* providers: [{provide: NG_VALIDATORS, useExisting: CustomValidatorDirective, multi: true}]
|
||||
* })
|
||||
* class CustomValidatorDirective implements Validator {
|
||||
* validate(c: AbstractControl): {[key: string]: any} {
|
||||
* validate(c: AbstractControl): ValidationErrors|null {
|
||||
* return {'custom': true};
|
||||
* }
|
||||
* }
|
||||
@ -49,7 +49,7 @@ export type ValidationErrors = {
|
||||
export interface Validator {
|
||||
/**
|
||||
* @description
|
||||
* Method that performs synchronous verification against the provided control.
|
||||
* Method that performs synchronous validation against the provided control.
|
||||
*
|
||||
* @param c The control to validate against.
|
||||
*
|
||||
@ -82,12 +82,12 @@ export interface Validator {
|
||||
* import { of as observableOf } from 'rxjs';
|
||||
*
|
||||
* @Directive({
|
||||
* selector: '[custom-async-validator]',
|
||||
* selector: '[customAsyncValidator]',
|
||||
* providers: [{provide: NG_ASYNC_VALIDATORS, useExisting: CustomAsyncValidatorDirective, multi:
|
||||
* true}]
|
||||
* })
|
||||
* class CustomAsyncValidatorDirective implements AsyncValidator {
|
||||
* validate(c: AbstractControl): Observable<{[key: string]: any}> {
|
||||
* validate(c: AbstractControl): Observable<ValidationErrors|null> {
|
||||
* return observableOf({'custom': true});
|
||||
* }
|
||||
* }
|
||||
@ -98,7 +98,7 @@ export interface Validator {
|
||||
export interface AsyncValidator extends Validator {
|
||||
/**
|
||||
* @description
|
||||
* Method that performs async verification against the provided control.
|
||||
* Method that performs async validation against the provided control.
|
||||
*
|
||||
* @param c The control to validate against.
|
||||
*
|
||||
|
Reference in New Issue
Block a user