MCPcopy Create free account
hub / github.com/angularcafe/slateui / constructor

Method constructor

projects/docs/src/app/pages/docs/docs.ts:33–55  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

31 readonly isBrowser = computed(() => isPlatformBrowser(this.platform));
32
33 constructor() {
34 // Navigation listener with automatic cleanup
35 this.router.events
36 .pipe(
37 filter(event => event instanceof NavigationEnd),
38 takeUntilDestroyed()
39 )
40 .subscribe(() => this.menuOpen.set(false));
41
42 // Body overflow management only in browser
43 if (this.isBrowser()) {
44 effect(() => {
45 // Prevent scrolling when mobile menu is open
46 if (this.menuOpen()) {
47 document.body.style.overflow = 'hidden';
48 document.body.classList.add('menu-open');
49 } else {
50 document.body.style.overflow = '';
51 document.body.classList.remove('menu-open');
52 }
53 });
54 }
55 }
56
57 // Enhanced menu toggle with proper accessibility
58 toggleMenu(): void {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected