mirror of
https://github.com/akveo/ngx-admin.git
synced 2026-02-19 14:38:07 +01:00
22 lines
480 B
TypeScript
22 lines
480 B
TypeScript
|
|
import {Injectable} from 'angular2/core'
|
||
|
|
import {Subject} from 'rxjs/Subject';
|
||
|
|
|
||
|
|
@Injectable()
|
||
|
|
export class SidebarStateService {
|
||
|
|
|
||
|
|
// Observable string sources
|
||
|
|
private _isCollapsed = new Subject<boolean>();
|
||
|
|
|
||
|
|
// Observable string streams
|
||
|
|
isCollapsedStream$ = this._isCollapsed.asObservable();
|
||
|
|
|
||
|
|
// Service message commands
|
||
|
|
stateChanged(isCollapsed: boolean) {
|
||
|
|
this._isCollapsed.next(isCollapsed)
|
||
|
|
}
|
||
|
|
|
||
|
|
getStateStream() {
|
||
|
|
return this.isCollapsedStream$;
|
||
|
|
}
|
||
|
|
}
|