Skip to main content
cngx-src documentation

CngxSidenavRouterSync

DirectivePrimaryv0.1.0

projects/ui/sidenav/sidenav-router-sync.directive.ts

Import#

import { CngxSidenavRouterSync } from '@cngx/ui/sidenav'

Description#

Deep-links a sidenav's open state into a query param. Opt-in via [cngxSidenavRouterSync] on a <cngx-sidenav>: opening writes ?nav=open, an initial ?nav=open hydrates it open, closing removes the param, and browser back/forward re-hydrates it. A thin caller over injectQueryParamSync - it reaches the rail through the CNGX_SIDENAV contract token, never the concrete class.

The param default cascades: per-instance [param] wins, then withSidenavRouterSync({ param }) on CNGX_SIDENAV_CONFIG, then the 'nav' literal. Without @angular/router the kernel dev-warns once and no-ops.

https://cngxjs.github.io/cngx/examples/#/ui/sidenav/router-sync/deep-linkable-overlay

Metadata#

Index#

Outputs

Derived State

Outputs#

syncError#unknown
output()

Emits when a router.navigate rejection is observed. Parity with the stepper sibling.