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

atinc / ngx-tethys / 5ba5b9d7-3ca9-4ff2-bbba-bde58c0f849f

22 Feb 2024 09:41AM UTC coverage: 90.604%. Remained the same
5ba5b9d7-3ca9-4ff2-bbba-bde58c0f849f

Pull #3027

circleci

minlovehua
feat(schematics): provide schematics for removing the suffix of standalone components #INFR-11662
Pull Request #3027: refactor: remove the component suffix for standalone components and provide schematics #INFR-10654

5425 of 6642 branches covered (81.68%)

Branch coverage included in aggregate %.

323 of 333 new or added lines in 193 files covered. (97.0%)

36 existing lines in 8 files now uncovered.

13504 of 14250 relevant lines covered (94.76%)

981.28 hits per line

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

89.47
/src/radio/radio.component.ts
1
import { Component, forwardRef, OnInit, Input, Optional, ChangeDetectionStrategy, ChangeDetectorRef } from '@angular/core';
2
import { NG_VALUE_ACCESSOR } from '@angular/forms';
3
import { ThyTranslate } from 'ngx-tethys/core';
4
import { ThyFormCheckBaseComponent } from 'ngx-tethys/shared';
5
import { ThyRadioGroup } from './group/radio-group.component';
6
import { coerceBooleanProperty } from 'ngx-tethys/util';
7
import { NgClass, NgIf } from '@angular/common';
8

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

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

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

45
    constructor(
46
        public thyTranslate: ThyTranslate,
47
        @Optional() public thyRadioGroupComponent: ThyRadioGroup,
1✔
48
        changeDetectorRef: ChangeDetectorRef
49
    ) {
50
        super(thyTranslate, changeDetectorRef);
51
    }
52

53
    ngOnInit() {
54
        if (this.thyRadioGroupComponent) {
55
            this.thyRadioGroupComponent.addRadio(this);
7✔
56
        }
57
    }
58

59
    change() {
60
        if (this.thyRadioGroupComponent) {
61
            this.thyRadioGroupComponent.updateValue(this.thyValue, true);
62
        } else {
63
            this.updateValue(!this._innerValue);
64
        }
65
    }
66
}
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