MCPcopy Create free account
hub / github.com/angular/angular / CustomValidator

Class CustomValidator

packages/forms/test/reactive_integration_spec.ts:75–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

DirectiveInterface · 0.90
forwardRefFunction · 0.90

Tested by

no test coverage detected