Skip to main content
cngx-src documentation

CngxMatTabRejectionContent

Directivev0.1.0WCAG AA

projects/ui/mat-tabs/decorations/mat-tab-rejection-content.directive.ts

Import#

import { CngxMatTabRejectionContent } from '@cngx/ui/mat-tabs'

Description#

Structural slot directive marking the rejection-descriptor template for [cngxMatTabs]. Discovered via contentChild on the directive; when bound, the projector renders an embedded view of this template into the SR-only descriptor span instead of writing the resolved fallback string verbatim.

Pure marker - zero logic. Holds only a typed TemplateRef reference. Mirrors the family-standard slot pattern (CngxMatTabAggregatorContent, CngxStepBadge, CngxTabErrorBadge).

Cascade resolution:

  1. Per-instance *cngxMatTabRejectionContent template wins via contentChild(CngxMatTabRejectionContent).
  2. Library default - imperative Renderer2.createElement('span') with textContent = fallbackText (the resolved commitRolledBackTo(originLabel) / commitFailedRetry phrase from injectTabsI18n()).
<mat-tab-group cngxMatTabs [commitAction]="save">
  <ng-template
    cngxMatTabRejectionContent
    let-failedHandleId="failedHandleId"
    let-originLabel="originLabel"
    let-fallbackText="fallbackText"
  >
    <span class="brand-icon" aria-hidden="true"></span>
    {{ fallbackText }}
    @if (originLabel) {
      <button (click)="retry(failedHandleId)">Retry</button>
    }
  </ng-template>
  <mat-tab label="Profile">…</mat-tab>
</mat-tab-group>

Metadata#

Index#

Properties

Instance Properties#

templateRef#unknown
Readonly
inject<TemplateRef<CngxMatTabRejectionContentContext>>(TemplateRef)