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

Class MustBeCheckedValidator

packages/forms/signals/test/web/template_fvc.spec.ts:664–674  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

662}
663
664@Directive({
665 selector: '[mustBeChecked]',
666 providers: [
667 {provide: NG_VALIDATORS, useExisting: forwardRef(() => MustBeCheckedValidator), multi: true},
668 ],
669})
670class MustBeCheckedValidator implements Validator {
671 validate(control: AbstractControl): ValidationErrors | null {
672 return control.value === true ? null : {mustBeChecked: true};
673 }
674}
675
676describe('NgModel with FVC and validator directives', () => {
677 it('should apply validator directives on the element to the control', async () => {

Callers

nothing calls this directly

Calls 2

DirectiveInterface · 0.90
forwardRefFunction · 0.90

Tested by

no test coverage detected