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

atinc / ngx-tethys / #55

30 Jul 2025 07:08AM UTC coverage: 9.866% (-80.4%) from 90.297%
#55

push

why520crazy
feat(empty): add setMessage for update display text #TINFR-2616

92 of 6794 branches covered (1.35%)

Branch coverage included in aggregate %.

2014 of 14552 relevant lines covered (13.84%)

6.15 hits per line

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

13.04
/src/form/form-group-error/form-group-error.component.ts
1
import { Component, HostBinding, ViewEncapsulation, OnInit, Input, inject, input } from '@angular/core';
2
import { ThyFormDirective } from '../form.directive';
3
import { ThyAlert } from 'ngx-tethys/alert';
4
import { NgClass } from '@angular/common';
5
import { coerceBooleanProperty } from 'ngx-tethys/util';
6

7
/**
8
 * @name thy-form-group-error
9
 * @order 50
10
 */
11
@Component({
12
    selector: 'thy-form-group-error',
13
    templateUrl: './form-group-error.component.html',
1✔
14
    encapsulation: ViewEncapsulation.None,
15
    imports: [NgClass, ThyAlert]
×
16
})
×
17
export class ThyFormGroupError implements OnInit {
×
18
    private thyParentForm = inject(ThyFormDirective, { optional: true })!;
19

20
    public errors: string[];
×
21

22
    readonly thyShowFirst = input(true, { transform: coerceBooleanProperty });
23

×
24
    /**
×
25
     * @type string[]
26
     */
27
    @Input()
×
28
    set thyErrors(errors: string[]) {
29
        this.errors = errors;
30
    }
×
31

×
32
    get thyErrors() {
33
        const errors = this.errors || this.thyParentForm.validator.errors;
34
        return errors && errors.length > 0 && this.thyShowFirst() ? [errors[0]] : errors;
1✔
35
    }
36

37
    @HostBinding('class.form-group')
38
    get _isFormGroup() {
39
        return this.thyErrors && this.thyErrors.length > 0;
40
    }
41

1✔
42
    @HostBinding('class.row') isHorizontal = true;
43

44
    ngOnInit() {
45
        if (this.thyParentForm) {
46
            this.isHorizontal = this.thyParentForm.isHorizontal;
47
        }
48
    }
49
}
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

© 2026 Coveralls, Inc