OpenArticleOnCtrlEnter
Open an article in a new browser tab when the user presses Ctrl+Enter while the host element is focused.
[openArticleOnCtrlEnter] opens an article's preview in a new browser tab when the user presses Ctrl+Enter
while the host element is focused — the same "open in background tab" gesture browsers already give search
result links.
Minimal example
import { Component, input } from "@angular/core";
import { OpenArticleOnCtrlEnterDirective } from "@sinequa/atomic-angular";
import type { Article } from "@sinequa/atomic";
@Component({
selector: "result-row",
imports: [OpenArticleOnCtrlEnterDirective],
template: `<div tabindex="0" [article]="article()" openArticleOnCtrlEnter>{{ article().title }}</div>`,
})
export class ResultRowComponent {
readonly article = input.required<Article>();
}The host element needs to be focusable (a tabindex, or a naturally focusable element) for the keydown to
ever reach it.
Options
Prop
Type
This directive has no outputs — opening happens as a side effect through the injected PreviewService.
What's next
SelectArticle
Select an article on click or Enter — replace it as the current selection, redirect to a preview route, or emit it — from a single directive.
ChildMarker
Mark a projected <ng-template> so a parent component can discover and render it dynamically, for structural composition patterns like a @for loop over projected children.