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

atinc / ngx-tethys / d9ae709b-3c27-4b69-b125-b8b80b54f90b

pending completion
d9ae709b-3c27-4b69-b125-b8b80b54f90b

Pull #2757

circleci

mengshuicmq
fix: fix code review
Pull Request #2757: feat(color-picker): color-picker support disabled (#INFR-8645)

98 of 6315 branches covered (1.55%)

Branch coverage included in aggregate %.

1 of 1 new or added line in 1 file covered. (100.0%)

2392 of 13661 relevant lines covered (17.51%)

83.12 hits per line

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

33.33
/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;
×
7
        return !isEqual ? { confirm: { value: value, actual: control.value } } : null;
×
8
    };
×
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
    standalone: true
1✔
21
})
22
export class ThyConfirmValidatorDirective implements Validator {
23
    /**
24
     * 表单控件的校验值
1✔
25
     */
26
    @Input() confirm: string;
27

28
    validate(control: AbstractControl) {
29
        return confirmValidator(this.confirm)(control);
30
    }
31
}
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