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

atinc / ngx-tethys / #71

06 Aug 2025 02:34AM UTC coverage: 9.672% (-80.6%) from 90.298%
#71

push

web-flow
feat(date-picker): add dateCellRender #TINFR-2386 (#3495) (#3499)

104 of 6813 branches covered (1.53%)

Branch coverage included in aggregate %.

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

11855 existing lines in 343 files now uncovered.

1969 of 14620 relevant lines covered (13.47%)

6.13 hits per line

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

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

4
/**
5
 * @name thyCtrlEnter
6
 */
7
@Directive({
1✔
8
    selector: '[thyCtrlEnter]'
UNCOV
9
})
×
UNCOV
10
export class ThyCtrlEnterDirective implements OnInit, OnDestroy {
×
UNCOV
11
    private ngZone = inject(NgZone);
×
UNCOV
12
    private elementRef = inject(ElementRef);
×
UNCOV
13
    private renderer = inject(Renderer2);
×
UNCOV
14

×
UNCOV
15
    @Output() thyCtrlEnter = new EventEmitter();
×
UNCOV
16

×
UNCOV
17
    private removeKeydownListenerFn: VoidFunction;
×
UNCOV
18

×
19
    onKeydown = (event: KeyboardEvent) => {
20
        const keyCode = event.which || event.keyCode;
21
        if ((event.ctrlKey || event.metaKey) && keyCode === keycodes.ENTER) {
22
            event.preventDefault();
23
            this.ngZone.run(() => {
UNCOV
24
                this.thyCtrlEnter.emit(event);
×
UNCOV
25
            });
×
26
        }
27
    };
28

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

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