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

atinc / ngx-tethys / 68ef226c-f83e-44c1-b8ed-e420a83c5d84

28 May 2025 10:31AM UTC coverage: 10.352% (-80.0%) from 90.316%
68ef226c-f83e-44c1-b8ed-e420a83c5d84

Pull #3460

circleci

pubuzhixing8
chore: xxx
Pull Request #3460: refactor(icon): migrate signal input #TINFR-1476

132 of 6823 branches covered (1.93%)

Branch coverage included in aggregate %.

10 of 14 new or added lines in 1 file covered. (71.43%)

11648 existing lines in 344 files now uncovered.

2078 of 14525 relevant lines covered (14.31%)

6.69 hits per line

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

16.67
/src/radio/radio.component.ts
1
import { coerceBooleanProperty } from '@angular/cdk/coercion';
2
import { NgClass } from '@angular/common';
3
import { ChangeDetectionStrategy, Component, forwardRef, inject, input, OnInit } from '@angular/core';
4
import { NG_VALUE_ACCESSOR } from '@angular/forms';
5
import { ThyFormCheckBaseComponent } from 'ngx-tethys/shared';
6
import { IThyRadioComponent, THY_RADIO_GROUP_COMPONENT } from './radio.token';
7

8
/**
9
 * 单选框组件
10
 * @name thy-radio,[thyRadio]
11
 * @order 10
12
 */
13
@Component({
14
    // eslint-disable-next-line @angular-eslint/component-selector
15
    selector: '[thy-radio],[thyRadio]',
1✔
16
    templateUrl: './radio.component.html',
UNCOV
17
    providers: [
×
UNCOV
18
        {
×
UNCOV
19
            provide: NG_VALUE_ACCESSOR,
×
20
            useExisting: forwardRef(() => ThyRadio),
21
            multi: true
UNCOV
22
        }
×
UNCOV
23
    ],
×
24
    host: {
25
        '[attr.tabindex]': `-1`
UNCOV
26
    },
×
UNCOV
27
    changeDetection: ChangeDetectionStrategy.OnPush,
×
28
    imports: [NgClass]
29
})
30
export class ThyRadio extends ThyFormCheckBaseComponent implements IThyRadioComponent, OnInit {
UNCOV
31
    thyRadioGroupComponent = inject(THY_RADIO_GROUP_COMPONENT, { optional: true })!;
×
32

×
33
    name: string;
34

UNCOV
35
    /**
×
36
     * 当和 thy-radio-group 配合使用时的值,选中后的 NgModel 值
37
     */
38
    readonly thyValue = input<string>();
1✔
39

40
    set thyChecked(value: boolean) {
41
        this.writeValue(coerceBooleanProperty(value));
42
        this.changeDetectorRef.markForCheck();
1✔
43
    }
44

45
    ngOnInit() {
46
        if (this.thyRadioGroupComponent) {
47
            this.thyRadioGroupComponent.addRadio(this);
48
        }
49
    }
UNCOV
50

×
51
    change() {
52
        if (this.thyRadioGroupComponent) {
53
            this.thyRadioGroupComponent.updateValue(this.thyValue(), true);
54
        } else {
55
            this.updateValue(!this._innerValue);
56
        }
57
    }
58
}
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