MCPcopy Index your code
hub / github.com/angular/angular / createValidatorClass

Function createValidatorClass

packages/forms/test/reactive_integration_spec.ts:72–90  ·  view source on GitHub ↗
(selector: string)

Source from the content-addressed store, hash-verified

70
71// Produces a new @Directive (with a given selector) that represents a validator class.
72function createValidatorClass(selector: string) {
73 @Directive({
74 selector,
75 providers: [
76 {
77 provide: NG_VALIDATORS,
78 useClass: forwardRef(() => CustomValidator),
79 multi: true,
80 },
81 ],
82 standalone: false,
83 })
84 class CustomValidator implements Validator {
85 validate(control: AbstractControl) {
86 return null;
87 }
88 }
89 return CustomValidator;
90}
91
92// Produces a new @Directive (with a given selector) that represents an async validator class.
93function createAsyncValidatorClass(selector: string) {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…