CngxMatTabRejectionContentContext
projects/ui/mat-tabs/decorations/mat-tab-rejection-content.directive.ts
Import#
import { CngxMatTabRejectionContentContext } from '@cngx/ui/mat-tabs'
Description#
Context passed to the *cngxMatTabRejectionContent template. Drives
the SR-descriptor content rendered inside the
<span class="cngx-sr-only"> decoration that [cngxMatTabs]
appends to a Material tab button when its bound commitAction
rejects a tab change. The surrounding span (with its
cngx-sr-only class, its stable id, and the aria-describedby
wiring on the button) stays library-owned - the slot only
customises the descriptor text or markup so consumers can swap
the rejection phrasing (branded prefixes, retry CTAs, localised
templates) without fighting the AT contract.
failedHandleId is the stable id of the rejected handle (the
same id the descriptor span uses as its ${id}-rejected DOM id);
originLabel is the label the rollback returned to (when the
presenter exposes an originIndexDuringCommit and that index
resolves to a handle with a non-empty label) - undefined when
no labelled rollback origin is resolvable; fallbackText is the
built-in i18n phrase the imperative fallback path would write
verbatim (typically commitRolledBackTo(originLabel) when the
origin is resolvable, commitFailedRetry otherwise).
Re-instantiation warning. The decoration projector destroys
the embedded view and creates a fresh one on every descriptorText
re-emission - typical when the rollback origin label resolves
later than the failed-handle id (e.g. presenter.tabs() re-emits
mid-rejection and the origin label flows in on the second tick).
The slot template runs to the end of its lifecycle each time;
consumers wiring expensive subtrees (e.g. an embedded chart, a
complex form) should treat this as a destroy + remount cycle and
lift heavy state into a sibling *ngTemplateOutlet-friendly
structure outside the slot. Cheap text + simple markup (the
intended use) sees no observable difference.
Index#
Properties
Instance Properties#
Library-default i18n phrase the imperative fallback path would write verbatim. Use this if the consumer template wants to render the canonical phrase as a base alongside its own decoration (icon, branded prefix, retry CTA).
string | undefinedLabel of the rollback origin (only set when the presenter's
originIndexDuringCommit resolves to a handle with a non-empty
label).