Skip to main content
Version: 11.14.0

Selection

The SelectionService manages the current article selection and synchronizes it with the query parameters store.

Methods

setCurrentArticle()

Sets the currently selected article and optionally updates the query text.

setCurrentArticle(article?: Article, withQueryText?: boolean): void
NameTypeRequiredDescription
articleArticleThe article to select. If undefined, clears the current selection.
withQueryTextbooleanWhether to update the query text in the selection store. Default: true.

Example

example.component.ts
import { inject } from '@angular/core';
import { SelectionService } from '@sinequa/atomic-angular';

inject(SelectionService).setCurrentArticle({ id: '123', title: 'Sample Article' });

clearCurrentArticle()

Clears the current article selection and removes the article ID from query parameters.

clearCurrentArticle(): void

Example

inject(SelectionService).clearCurrentArticle();