Skip to main content
cngx-src documentation

createMatTabHandle

Functionui/mat-tabs

projects/ui/mat-tabs/material-bridge/handle.ts

Description#

Translates a Material MatTab into a cngx CngxTabHandle plus a writable errorAggregator slot the [cngxMatTabError] directive binds.

  • id - fresh idSeed() value; a label-keyed id would collide when two tabs share a label.
  • label / disabled - computed signals retriggered by toSignal(matTab._stateChanges). Bridge lifetime is tied to the supplied injector (typically a per-tab child EnvironmentInjector). _stateChanges is a Material-internal surface.
  • errorAggregator - writable seeded at undefined; [cngxMatTabError] writes its bound aggregator in and resets on teardown. The handle exposes .asReadonly() to preserve the CngxTabHandle contract.
  • directError - writable seeded at false; [cngxMatTabErrorFlag] writes its string | boolean value in and resets on teardown. Folds into hasError / errorMessage.

Signature#

createMatTabHandle(matTab: MatTab, idSeed, injector: Injector)

Parameters#

@parammatTabMatTab
@paramidSeed
@paraminjectorInjector

Returns#

CngxMatTabHandleSetup