• 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

20.0
/src/shared/directives/thy-enter.directive.ts
1
import { Directive, Output, EventEmitter, OnInit, NgZone, ElementRef, Renderer2, OnDestroy } from '@angular/core';
2
import { keycodes } from 'ngx-tethys/util';
3

4
/**
5
 * 与 (keydown.enter) 区别是支持组合键,当按 Ctrl + Enter 或者 Command + Enter 也会触发
6
 * @name thyEnter
7
 */
8
@Directive({
1✔
9
    selector: '[thyEnter]',
10
    standalone: true
×
11
})
×
12
export class ThyEnterDirective implements OnInit, OnDestroy {
×
13
    @Output() thyEnter = new EventEmitter();
×
14

×
15
    onKeydown = (event: KeyboardEvent) => {
×
16
        const keyCode = event.which || event.keyCode;
×
17
        if (keyCode === keycodes.ENTER) {
×
18
            this.ngZone.run(() => {
×
19
                this.thyEnter.emit(event);
20
            });
21
        }
22
    };
23

24
    private removeKeydownListenerFn: VoidFunction;
×
25

×
26
    constructor(private ngZone: NgZone, private elementRef: ElementRef, private renderer: Renderer2) {}
27

28
    ngOnInit(): void {
29
        this.ngZone.runOutsideAngular(() => {
×
30
            this.removeKeydownListenerFn = this.renderer.listen(this.elementRef.nativeElement, 'keydown', this.onKeydown);
31
        });
1✔
32
    }
33

34
    ngOnDestroy(): void {
35
        this.removeKeydownListenerFn();
36
    }
1✔
37
}
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