• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

atinc / ngx-tethys / 8bd9de98-473d-41f7-abc2-99e29d3de017

16 May 2025 09:16AM UTC coverage: 90.351% (+0.009%) from 90.342%
8bd9de98-473d-41f7-abc2-99e29d3de017

push

circleci

xinglu01
feat(menu): migrate to signal for menu

5579 of 6842 branches covered (81.54%)

Branch coverage included in aggregate %.

13589 of 14373 relevant lines covered (94.55%)

909.0 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

80.0
/src/form/validator/confirm-validator.directive.ts
1
import { Directive, input } from '@angular/core';
2
import { AbstractControl, NG_VALIDATORS, Validator, ValidatorFn } from '@angular/forms';
3

4
export function confirmValidator(value: string): ValidatorFn {
5
    return (control: AbstractControl): { [key: string]: any } | null => {
6
        const isEqual = value === control.value;
2✔
7
        return !isEqual ? { confirm: { value: value, actual: control.value } } : null;
2✔
8
    };
2✔
9
}
10

11
/**
12
 * confirm validator,用于确认两次输入是否一致
13
 * @name confirm
14
 * @order 25
15
 */
16
@Directive({
1✔
17
    // eslint-disable-next-line @angular-eslint/directive-selector
18
    selector: '[confirm]',
×
19
    providers: [{ provide: NG_VALIDATORS, useExisting: ThyConfirmValidatorDirective, multi: true }]
20
})
21
export class ThyConfirmValidatorDirective implements Validator {
×
22
    /**
23
     * 表单控件的校验值
1✔
24
     */
25
    readonly confirm = input<string>(undefined);
26

27
    validate(control: AbstractControl) {
1✔
28
        return confirmValidator(this.confirm())(control);
29
    }
30
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc