Skip to main content
cngx-src documentation

CngxMatTabErrorFlag

Directivev0.1.0WCAG AA

projects/ui/mat-tabs/mat-tab-error-flag.directive.ts

Import#

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

Description#

Per-tab direct invalid flag for [cngxMatTabs] - the simple-case sibling to [cngxMatTabError]. Attach to a <mat-tab>; the bound string | boolean writes the per-handle directError slot, which folds into the handle's hasError / errorMessage. A non-empty string doubles as the SR descriptor message; true marks the tab invalid with no message; false / '' clear it.

Symmetric with [cngxMatTabError] (one directive, one responsibility - Pillar 3): the aggregator stays the rich multi-source path, this is the "this tab is invalid" marker that needs no aggregator boilerplate. A bare cngxMatTabErrorFlag attribute (no brackets) binds the empty string and is coerced to true so presence alone marks the tab invalid.

Locates its target via CNGX_MAT_TABS_REGISTRY_HOST, tracks presenter.tabs() to recover from the content-init race, and clears the slot on destroy - exactly as CngxMatTabError.

Metadata#

Index#

Inputs

Inputs#

error#string | boolean, string | boolean
input()
default
false, {    alias: 'cngxMatTabErrorFlag',    transform: (value) => (value === '' ? true : value),  }