Skip to main content
cngx-src documentation

CNGX_MAT_STEP_HANDLE_FACTORY

Tokenv0.1.0WCAG AA

InjectionToken<CngxMatStepHandleFactory>

Description#

DI token fronting the per-step handle factory used by the [cngxMatStepper] instrumentation directive. Default is createMatStepHandle.

Symmetric with the tabs sibling CNGX_MAT_TAB_HANDLE_FACTORY and with CNGX_TAB_OVERFLOW_DOM_ADAPTER_FACTORY

  • every Material-bridge logic block ships the same swap surface so consumers can layer telemetry, alternate id strategies, or test-environment id keying via providers / viewProviders without forking the directive.

Override capability - the swap surface separates handle shape (factory body) from id keying (the supplied idSeed closure). The directive constructs idSeed as () => nextUid('cngx-mat-step-') and hands it to the factory as a default suggestion; an override is free to call it, ignore it, or replace it with a server-synced / deterministic-test / consumer-domain id strategy. Both axes are independently swappable from one DI seam.

providers: [
  {
    provide: CNGX_MAT_STEP_HANDLE_FACTORY,
    useValue: ((step, idSeed) => {
      const setup = createMatStepHandle(step, idSeed);
      reportStepRegistered(setup.handle.id);
      return setup;
    }) satisfies CngxMatStepHandleFactory,
  },
]

Type#

InjectionToken<CngxMatStepHandleFactory>

Provided in#

'root'