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

atinc / ngx-tethys / 07aa0f59-e5f9-4b7e-9755-2f67bea3c0d5

21 Apr 2025 10:25AM UTC coverage: 90.271% (+0.001%) from 90.27%
07aa0f59-e5f9-4b7e-9755-2f67bea3c0d5

Pull #3341

circleci

minlovehua
docs(cdk): merge imports
Pull Request #3341: refactor(all): resolve 30 circular denpendencies TINFR-1830

5614 of 6878 branches covered (81.62%)

Branch coverage included in aggregate %.

89 of 94 new or added lines in 38 files covered. (94.68%)

64 existing lines in 12 files now uncovered.

13370 of 14152 relevant lines covered (94.47%)

921.99 hits per line

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

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

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

33
    name: string;
3✔
34

35
    /**
36
     * 当和 thy-radio-group 配合使用时的值,选中后的 NgModel 值
1✔
37
     */
38
    @Input() thyValue: string;
39

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

45
    ngOnInit() {
46
        if (this.thyRadioGroupComponent) {
47
            this.thyRadioGroupComponent.addRadio(this);
48
        }
9✔
49
    }
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