/** Angular Imports */ import { Component , OnInit , ChangeDetectorRef , OnDestroy } from '@angular/core' ; import { BreakpointObserver , Breakpoints } from '@angular/cdk/layout' ; /** rxjs Imports */ import { Observable , Subscription } from 'rxjs' ; import { map } from 'rxjs/operators' ; /** Custom Services */ import { ProgressBarService } from '../progress-bar/progress-bar.service' ; /**
 * Shell component.
 */ @ Component ( { selector : 'mifosx-shell' , templateUrl : './shell.component.html' , styleUrls : [ './shell.component.scss' ] } ) export class ShellComponent implements OnInit , OnDestroy { /** Subscription to breakpoint observer for handset. */ isHandset$ : Observable < boolean > = this . breakpointObserver . observe ( Breakpoints . Handset ) . pipe ( map ( result => result . matches ) ) ; /** Sets the initial state of sidenav as collapsed. Not collapsed if false. */ sidenavCollapsed = true ; /** Progress bar mode. */ progressBarMode : string ; /** Subscription to progress bar. */ progressBar$ : Subscription ; param { BreakpointObserver } breakpointObserver param { ProgressBarService } progressBarService param { ChangeDetectorRef } cdr constructor ( private breakpointObserver , private progressBarService , private cdr ) { } /**
     * Subscribes to progress bar to update its mode.
     */ ngOnInit ( ) { this . progressBar$ = this . progressBarService . updateProgressBar . subscribe ( ( mode ) => { this . progressBarMode = mode ; this . cdr . detectChanges ( ) ; } ) ; } param { boolean } event toggleCollapse ( $event ) { this . sidenavCollapsed = $event ; this . cdr . detectChanges ( ) ; } /**
     * Unsubscribes from progress bar.
     */ ngOnDestroy ( ) { this . progressBar$ . unsubscribe ( ) ; } }