import { Component , OnDestroy , OnInit , ViewEncapsulation , Input } from '@angular/core' ; import { Subject } from 'rxjs' ; import { filter , takeUntil } from 'rxjs/operators' ; import { FuseConfigService } from '@fuse/services/config.service' ; import { FuseNavigationService } from '@fuse/components/navigation/navigation.service' ; import { FuseSidebarService } from '@fuse/components/sidebar/sidebar.service' ; @ Component ( { selector : 'navbar-horizontal-style-1' , templateUrl : './style-1.component.html' , styleUrls : [ './style-1.component.scss' ] , encapsulation : ViewEncapsulation . None } ) export class NavbarHorizontalStyle1Component implements OnInit , OnDestroy { fuseConfig : any ; navigation : any ; @ Input ( 'selectedAccount' ) selectedAccount : Account ; private _unsubscribeAll : Subject < any > ; param { FuseConfigService } _fuseConfigService param { FuseNavigationService } _fuseNavigationService param { FuseSidebarService } _fuseSidebarService constructor ( private _fuseConfigService , private _fuseNavigationService , private _fuseSidebarService ) { this . _unsubscribeAll = new Subject ( ) ; } /**
     * On init
     */ ngOnInit ( ) { this . _fuseNavigationService . onNavigationChanged . pipe ( filter ( value => value !== null ) , takeUntil ( this . _unsubscribeAll ) ) . subscribe ( ( ) => { this . navigation = this . _fuseNavigationService . getCurrentNavigation ( ) ; } ) ; this . _fuseConfigService . config . pipe ( takeUntil ( this . _unsubscribeAll ) ) . subscribe ( ( config ) => { this . fuseConfig = config ; } ) ; } /**
     * On destroy
     */ ngOnDestroy ( ) { this . _unsubscribeAll . next ( ) ; this . _unsubscribeAll . complete ( ) ; } }