• 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

4.65
/src/core/update-host-class.service.ts
1
import { Injectable, Renderer2, ElementRef, inject } from '@angular/core';
2
import { Dictionary } from 'ngx-tethys/types';
3

1✔
4
@Injectable()
UNCOV
5
export class UpdateHostClassService {
×
UNCOV
6
    private renderer = inject(Renderer2);
×
7

8
    private _classNames: string[] = [];
UNCOV
9

×
10
    private _hostElement: HTMLElement;
×
11

12
    initializeElement(element: HTMLElement | ElementRef<HTMLElement>) {
UNCOV
13
        if (element instanceof ElementRef) {
×
14
            this._hostElement = element.nativeElement;
UNCOV
15
        } else {
×
16
            this._hostElement = element;
17
        }
UNCOV
18
        return this;
×
UNCOV
19
    }
×
UNCOV
20

×
UNCOV
21
    updateClass(classNames: string[]) {
×
22
        if (this._classNames) {
23
            this._classNames.forEach(className => {
24
                if (classNames.indexOf(className) < 0) {
UNCOV
25
                    this.removeClass(className);
×
UNCOV
26
                }
×
UNCOV
27
            });
×
UNCOV
28
        }
×
UNCOV
29
        const newClasses: string[] = [];
×
UNCOV
30
        classNames.forEach(className => {
×
31
            if (className) {
32
                newClasses.push(className);
33
                if (this._classNames.indexOf(className) < 0) {
UNCOV
34
                    this.addClass(className);
×
UNCOV
35
                }
×
36
            }
37
        });
38
        this._classNames = newClasses;
×
39
        return this;
×
40
    }
×
41

×
42
    updateClassByMap(classMap: Dictionary<boolean>) {
43
        const newClasses = [];
44
        for (const key in classMap) {
×
45
            if (classMap.hasOwnProperty(key) && classMap[key]) {
46
                newClasses.push(key);
UNCOV
47
            }
×
UNCOV
48
        }
×
49
        this.updateClass(newClasses);
50
    }
UNCOV
51

×
UNCOV
52
    addClass(className: string) {
×
53
        this.renderer.addClass(this._hostElement, className);
54
        return this;
55
    }
1✔
56

57
    removeClass(className: string) {
58
        this.renderer.removeClass(this._hostElement, className);
59
        return this;
60
    }
61
}
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