Skip to main content
cngx-src documentation

injectTocConfig

Functionui/tocv0.1.0

projects/ui/toc/config/inject-toc-config.ts

Description#

Convenience accessor for the toc configuration cascade. Runs in injection context; resolves through the priority chain (per-instance Input -> provideTocConfigAt -> provideTocConfig -> library defaults). Equivalent to inject(CNGX_TOC_CONFIG) - the helper exists so consumers don't import the token directly. Mirrors injectBreadcrumbConfig.

export class CngxToc {
  private readonly cfg = injectTocConfig();
  protected readonly navLabel = computed(() => this.cfg.ariaLabels?.nav ?? 'On this page');
}

Signature#

injectTocConfig()

Returns#

CngxTocConfig