File

src/lib/sidenav/sidenav.component.service.ts

Index

Properties
Methods

Constructor

constructor(config: ConfigService)
Parameters :
Name Type Optional
config ConfigService No

Methods

Public toggleNavigationCollapse
toggleNavigationCollapse()
Returns : void

Properties

Public Readonly collapsed$
Default value : new BehaviorSubject(true)
import { Injectable } from '@angular/core';
import { BehaviorSubject } from 'rxjs';
import { ConfigService } from '@rxap/config';

@Injectable({ providedIn: 'root' })
export class SidenavComponentService {

  public readonly collapsed$ = new BehaviorSubject(true);

  constructor(private readonly config: ConfigService) {
    this.collapsed$.next(this.config.get('navigation.collapsed', this.collapsed$.value));
  }

  public toggleNavigationCollapse(): void {
    this.collapsed$.next(!this.collapsed$.value);
  }

}

results matching ""

    No results matching ""