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

atinc / ngx-tethys / 579a112b-c71a-4227-850f-e26f12e5b875

14 May 2025 07:12AM UTC coverage: 90.273% (-0.001%) from 90.274%
579a112b-c71a-4227-850f-e26f12e5b875

Pull #3415

circleci

web-flow
Merge branch 'master' into why520crazy/#TINFR-1472
Pull Request #3415: refactor(form): update all inputs to signal #TINFR-1472

5617 of 6883 branches covered (81.61%)

Branch coverage included in aggregate %.

34 of 34 new or added lines in 4 files covered. (100.0%)

3 existing lines in 2 files now uncovered.

13408 of 14192 relevant lines covered (94.48%)

919.95 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
UNCOV
18
    selector: '[confirm]',
×
19
    providers: [{ provide: NG_VALIDATORS, useExisting: ThyConfirmValidatorDirective, multi: true }]
20
})
UNCOV
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