import { Component , EventEmitter , OnDestroy , OnInit , Output } from '@angular/core' ; import { Subject } from 'rxjs' ; import { takeUntil } from 'rxjs/operators' ; import { FuseConfigService } from '@fuse/services/config.service' ; @ Component ( { selector : 'fuse-search-bar' , templateUrl : './search-bar.component.html' , styleUrls : [ './search-bar.component.scss' ] } ) export class FuseSearchBarComponent implements OnInit , OnDestroy { collapsed : boolean ; fuseConfig : any ; @ Output ( ) input : EventEmitter < any > ; private _unsubscribeAll : Subject < any > ; param { FuseConfigService } _fuseConfigService constructor ( private _fuseConfigService ) { this . input = new EventEmitter ( ) ; this . collapsed = true ; this . _unsubscribeAll = new Subject ( ) ; } /**
     * On init
     */ ngOnInit ( ) { this . _fuseConfigService . config . pipe ( takeUntil ( this . _unsubscribeAll ) ) . subscribe ( ( config ) => { this . fuseConfig = config ; } ) ; } /**
     * On destroy
     */ ngOnDestroy ( ) { this . _unsubscribeAll . next ( ) ; this . _unsubscribeAll . complete ( ) ; } /**
     * Collapse
     */ collapse ( ) { this . collapsed = true ; } /**
     * Expand
     */ expand ( ) { this . collapsed = false ; } param event search ( event ) { this . input . emit ( event . target . value ) ; } }