import { V3TopbarComponent } from './v3-topbar/v3-topbar.component' ; import { FeaturesService } from '../../services/features.service' ; import { Injectable } from '@angular/core' ; import { Subscription } from 'rxjs' ; import { NavigationEnd , Router } from '@angular/router' ; import { filter } from 'rxjs/operators' ; type TopbarComponentT = V3TopbarComponent ; @ Injectable ( ) export class TopbarService { private container : TopbarComponentT ; routerSubscription : Subscription ; constructor ( private featuresService , private router ) { this . routerSubscription = this . router . events . pipe ( filter ( e => e instanceof NavigationEnd ) ) . subscribe ( data => { this . toggleVisibility ( true ) ; this . toggleSearchBar ( true ) ; } ) ; } setContainer ( container ) { this . container = container ; return this ; } toggleMarketingPages ( value , showBottombar = true , forceBackground = true ) { } toggleVisibility ( visible ) { if ( this . container ) { this . container . toggleVisibility ( visible ) ; } } toggleSearchBar ( visible ) { if ( this . container ) { ( < V3TopbarComponent > this . container ) . toggleSearchBar ( visible ) ; } } }