CngxMatTabError
projects/ui/mat-tabs/mat-tab-error.directive.ts
Import#
import { CngxMatTabError } from '@cngx/ui/mat-tabs'
Description#
Per-tab error-aggregator binding for [cngxMatTabs]. Attach to a
<mat-tab>; the bound aggregator's shouldShow() projects onto
the matching Material tab button (badge + descriptor span) via
the Renderer2 effect inside CngxMatTabs.
Material owns <mat-tab> declarations - [cngxTab] cannot host
here - so a sibling attribute directive carries the input.
Empty-string transform handles the bare-attribute case per
feedback_bridge_input_not_required (a developer typing
cngxMatTabError without [] brackets must not poison the
slot).
Locates its target via CNGX_MAT_TABS_REGISTRY_HOST -
the registry provides the token with useExisting, so sibling
directives reach per-handle slots through a typed contract
instead of the concrete class. Tracks presenter.tabs() to
recover from a same-microtask race where the directive injects
before the registry's sync runs. destroyRef.onDestroy clears
the slot so an *ngIf-toggled binding returns to the
no-aggregator default.