Skip to main content
cngx-src documentation

WINDOW

Tokenv0.1.0

InjectionToken<Window | null>

Description#

Provides access to the browser Window object. Returns null in SSR.

Always null-check the injected value — do not assert with !:

const win = injectWindow();
if (!win) return; // SSR — no window available
win.matchMedia('(min-width: 1024px)');

Type#

InjectionToken<Window | null>

Provided in#

'root'