mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
docs: update NG_VALIDATORS examples to use forwardRef (#63247)
PR Close #63247
This commit is contained in:
committed by
Jessica Janiuk
parent
2aa9775078
commit
6a6cb01bb3
@@ -75,7 +75,7 @@ export type ValidationErrors = {
|
||||
* ```ts
|
||||
* @Directive({
|
||||
* selector: '[customValidator]',
|
||||
* providers: [{provide: NG_VALIDATORS, useExisting: CustomValidatorDirective, multi: true}]
|
||||
* providers: [{provide: NG_VALIDATORS, useExisting: forwardRef(() => CustomValidatorDirective), multi: true}]
|
||||
* })
|
||||
* class CustomValidatorDirective implements Validator {
|
||||
* validate(control: AbstractControl): ValidationErrors|null {
|
||||
|
||||
@@ -65,7 +65,7 @@ function lengthOrSize(value: unknown): number | null {
|
||||
* ```ts
|
||||
* @Directive({
|
||||
* selector: '[customValidator]',
|
||||
* providers: [{provide: NG_VALIDATORS, useExisting: CustomValidatorDirective, multi: true}]
|
||||
* providers: [{provide: NG_VALIDATORS, useExisting: forwardRef(() => CustomValidatorDirective), multi: true}]
|
||||
* })
|
||||
* class CustomValidatorDirective implements Validator {
|
||||
* validate(control: AbstractControl): ValidationErrors | null {
|
||||
|
||||
Reference in New Issue
Block a user