import { Component , OnDestroy , OnInit , ViewEncapsulation } from '@angular/core' ; import { Subject } from 'rxjs' ; import { takeUntil } from 'rxjs/operators' ; import { fuseAnimations } from '@fuse/animations' ; import { MessagesService } from '../../messages.service' ; @ Component ( { selector : 'message-left-sidenav' , templateUrl : './left.component.html' , styleUrls : [ './left.component.scss' ] , encapsulation : ViewEncapsulation . None , animations : fuseAnimations } ) export class MessageLeftSidenavComponent implements OnInit , OnDestroy { view : string ; private _unsubscribeAll : Subject < any > ; param { MessagesService } _messageService constructor ( private _messageService ) { this . view = 'messages' ; this . _unsubscribeAll = new Subject ( ) ; } /**
     * On init
     */ ngOnInit ( ) { this . _messageService . onLeftSidenavViewChanged . pipe ( takeUntil ( this . _unsubscribeAll ) ) . subscribe ( view => { this . view = view ; } ) ; } /**
     * On destroy
     */ ngOnDestroy ( ) { this . _unsubscribeAll . next ( ) ; this . _unsubscribeAll . complete ( ) ; } }