Skip to main content
cngx-src documentation

injectTagConfig

Functioncommon/display

projects/common/display/tag/config/inject-tag-config.ts

Description#

Convenience accessor for the tag-family configuration cascade. Runs in injection context; resolves through the priority chain (per-instance Input → provideTagConfigAtprovideTagConfig → library defaults).

Equivalent to inject(CNGX_TAG_CONFIG) — the helper exists so consumers don't need to import the token directly. Mirrors injectSelectConfig in @cngx/forms/select.

export class MyDirective {
  private readonly cfg = injectTagConfig();
  readonly variant = input<CngxTagVariant>(
    this.cfg.defaults?.variant ?? 'filled',
  );
}

Signature#

injectTagConfig()

Returns#

CngxTagConfig