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

atinc / ngx-tethys / d9ae709b-3c27-4b69-b125-b8b80b54f90b

pending completion
d9ae709b-3c27-4b69-b125-b8b80b54f90b

Pull #2757

circleci

mengshuicmq
fix: fix code review
Pull Request #2757: feat(color-picker): color-picker support disabled (#INFR-8645)

98 of 6315 branches covered (1.55%)

Branch coverage included in aggregate %.

1 of 1 new or added line in 1 file covered. (100.0%)

2392 of 13661 relevant lines covered (17.51%)

83.12 hits per line

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

26.67
/src/menu/item/menu-item.component.ts
1
import { Component, OnInit, AfterViewInit, ChangeDetectionStrategy, Input, Renderer2, ElementRef, ViewChild } from '@angular/core';
2
import { ThyIconComponent } from 'ngx-tethys/icon';
3
import { NgIf } from '@angular/common';
4

5
/**
6
 * 菜单项组件
7
 * @name thy-menu-item,[thy-menu-item],[thyMenuItem]
8
 * @order 10
9
 */
10
@Component({
11
    selector: 'thy-menu-item,[thy-menu-item],[thyMenuItem]',
1✔
12
    templateUrl: './menu-item.component.html',
13
    changeDetection: ChangeDetectionStrategy.OnPush,
×
14
    host: {
15
        class: 'thy-menu-item'
16
    },
17
    standalone: true,
×
18
    imports: [NgIf, ThyIconComponent]
19
})
20
export class ThyMenuItemComponent implements OnInit, AfterViewInit {
×
21
    @ViewChild('content', { read: ElementRef }) content: ElementRef<HTMLElement>;
×
22
    /**
×
23
     * 菜单项的图标
×
24
     */
×
25
    @Input() thyIcon: string;
×
26

×
27
    constructor(private renderer: Renderer2) {}
28

29
    ngOnInit(): void {}
30

1✔
31
    ngAfterViewInit() {
32
        this.wrapSpanForText(this.content.nativeElement.childNodes);
33
    }
1✔
34

35
    private wrapSpanForText(nodes: NodeList): void {
36
        nodes.forEach(node => {
37
            if (node.nodeName === '#text') {
38
                const span = this.renderer.createElement('span');
1✔
39
                const parent = this.renderer.parentNode(node);
40
                this.renderer.addClass(span, 'thy-menu-item-name');
41
                this.renderer.insertBefore(parent, span, node);
42
                this.renderer.appendChild(span, node);
43
            }
44
        });
45
    }
46
}
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