File
Constructor
constructor(config: ConfigService)
|
|
Parameters :
Name |
Type |
Optional |
config |
ConfigService
|
No
|
|
Methods
Public
toggleNavigationCollapse
|
toggleNavigationCollapse()
|
|
|
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);
}
}