CngxMatTabsRegistry
projects/ui/mat-tabs/mat-tabs-registry.directive.ts
Import#
import { CngxMatTabsRegistry } from '@cngx/ui/mat-tabs'
Description#
Sibling host-directive that owns the per-MatTab handle registry
for [cngxMatTabs]. Keeps the parent under the level-4 organism
LOC guard and lets per-tab decoration directives reach the
registry through a typed token.
Owns: contentChildren(MatTab) query, the order-aware
registration seam (per-tab cngx setup paired with a child
EnvironmentInjector scoping the _stateChanges bridge), an
effect() that mirrors the MatTab query order into
CNGX_TAB_GROUP_HOST on every emission, and a DestroyRef
cleanup that unregisters and destroys every entry.
Order matters: the presenter registry appends new registrations,
but Material renders tabs at their DOM position - a mid-list
<mat-tab> insert must land at its query index, not at the tail,
or index-based selection, announcements and decorations target the
wrong tab. The shared seam re-registers the diverging suffix in
query order while keeping surviving handle instances (and their
child injectors) alive.
Composition: [cngxMatTabs] declares this in hostDirectives;
both share the parent's CngxTabGroupPresenter and the same
<mat-tab-group> content-children scope.
Metadata#
Providers#
CNGX_MAT_TABS_REGISTRY_HOST- useExisting
CngxMatTabsRegistry