Skip to main content
cngx-src documentation

provideTocConfig

Functionui/tocv0.1.0

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

Description#

Application-root configuration cascade for the toc organism. Pass any combination of withTocAriaLabels, withTocScrollBehavior, withTocSpy, and withTocTemplates features in bootstrapApplication's providers array.

Resolution priority (high -> low):

  1. Per-instance Input binding.
  2. provideTocConfigAt(...) in a parent component's viewProviders.
  3. provideTocConfig(...) at the application root.
  4. Library defaults (CNGX_TOC_DEFAULTS).

The provider deep-merges supplied features with the library defaults so consumers only declare keys they want to override.

bootstrapApplication(AppComponent, {
  providers: [
    provideTocConfig(
      withTocAriaLabels({ nav: 'On this page' }),
      withTocScrollBehavior('smooth'),
    ),
  ],
});

Signature#

provideTocConfig(...features: undefined)

Parameters#

@paramfeatures

Returns#

EnvironmentProviders