CngxSidenavRouterSync
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.